Pull in upstream fixes
This commit is contained in:
parent
708d9f3255
commit
384641dddd
@ -1,19 +1,35 @@
|
|||||||
|
diff --git a/style/adwaita.h b/style/adwaita.h
|
||||||
|
index b7c830a..09b970a 100644
|
||||||
|
--- a/style/adwaita.h
|
||||||
|
+++ b/style/adwaita.h
|
||||||
|
@@ -136,7 +136,7 @@ namespace Adwaita
|
||||||
|
|
||||||
|
// line editors
|
||||||
|
LineEdit_FrameWidth = 3,
|
||||||
|
- LineEdit_MarginHeight = 4,
|
||||||
|
+ LineEdit_MarginHeight = 2,
|
||||||
|
LineEdit_MarginWidth = 8,
|
||||||
|
LineEdit_MinHeight = 36,
|
||||||
|
LineEdit_MinWidth = 80,
|
||||||
diff --git a/style/adwaitastyle.cpp b/style/adwaitastyle.cpp
|
diff --git a/style/adwaitastyle.cpp b/style/adwaitastyle.cpp
|
||||||
index aeeb8ae..6d2860e 100644
|
index aeeb8ae..2287e0e 100644
|
||||||
--- a/style/adwaitastyle.cpp
|
--- a/style/adwaitastyle.cpp
|
||||||
+++ b/style/adwaitastyle.cpp
|
+++ b/style/adwaitastyle.cpp
|
||||||
@@ -392,6 +392,10 @@ void Style::polish(QWidget *widget)
|
@@ -392,7 +392,12 @@ void Style::polish(QWidget *widget)
|
||||||
} else if (widget->inherits("QTipLabel")) {
|
} else if (widget->inherits("QTipLabel")) {
|
||||||
setTranslucentBackground(widget);
|
setTranslucentBackground(widget);
|
||||||
} else if (QLineEdit *lineEdit = qobject_cast<QLineEdit *>(widget)) {
|
} else if (QLineEdit *lineEdit = qobject_cast<QLineEdit *>(widget)) {
|
||||||
|
- lineEdit->setTextMargins(Metrics::LineEdit_MarginWidth, Metrics::LineEdit_MarginHeight, Metrics::LineEdit_MarginWidth, Metrics::LineEdit_MarginHeight);
|
||||||
+ // Do not use additional margin if the QLineEdit is really small
|
+ // Do not use additional margin if the QLineEdit is really small
|
||||||
+ const bool useMarginWidth = lineEdit->width() > lineEdit->fontMetrics().width("#####");
|
+ const bool useMarginWidth = lineEdit->width() > lineEdit->fontMetrics().width("#####");
|
||||||
|
+ const bool useMarginHeight = lineEdit->height() > lineEdit->fontMetrics().height() + (2 * Metrics::LineEdit_MarginHeight);
|
||||||
|
+ const int marginHeight = useMarginHeight ? Metrics::LineEdit_MarginHeight : 0;
|
||||||
+ const int marginWidth = useMarginWidth ? Metrics::LineEdit_MarginWidth : 0;
|
+ const int marginWidth = useMarginWidth ? Metrics::LineEdit_MarginWidth : 0;
|
||||||
+ lineEdit->setTextMargins(marginWidth, Metrics::LineEdit_MarginHeight, marginWidth, Metrics::LineEdit_MarginHeight);
|
+ lineEdit->setTextMargins(marginWidth, marginHeight, marginWidth, marginHeight);
|
||||||
lineEdit->setTextMargins(Metrics::LineEdit_MarginWidth, Metrics::LineEdit_MarginHeight, Metrics::LineEdit_MarginWidth, Metrics::LineEdit_MarginHeight);
|
|
||||||
} else if (QSpinBox *spinBox = qobject_cast<QSpinBox *>(widget)) {
|
} else if (QSpinBox *spinBox = qobject_cast<QSpinBox *>(widget)) {
|
||||||
if (!spinBox->isEnabled()) {
|
if (!spinBox->isEnabled()) {
|
||||||
@@ -4844,7 +4848,7 @@ bool Style::drawMenuBarItemControl(const QStyleOption *option, QPainter *painter
|
QPalette pal = spinBox->palette();
|
||||||
|
@@ -4844,7 +4849,7 @@ bool Style::drawMenuBarItemControl(const QStyleOption *option, QPainter *painter
|
||||||
QRect textRect = option->fontMetrics.boundingRect(rect, textFlags, menuItemOption->text);
|
QRect textRect = option->fontMetrics.boundingRect(rect, textFlags, menuItemOption->text);
|
||||||
|
|
||||||
// render text
|
// render text
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
Name: adwaita-qt
|
Name: adwaita-qt
|
||||||
Version: 1.1.0
|
Version: 1.1.0
|
||||||
Release: 2%{?dist}
|
Release: 3%{?dist}
|
||||||
License: LGPLv2+
|
License: LGPLv2+
|
||||||
Summary: Adwaita theme for Qt-based applications
|
Summary: Adwaita theme for Qt-based applications
|
||||||
|
|
||||||
@ -76,6 +76,9 @@ make install/fast DESTDIR=%{buildroot} -C "%{_target_platform}-qt5"
|
|||||||
%files
|
%files
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Aug 13 2019 Jan Grulich <jgrulich@redhat.com> - 1.1.0-3
|
||||||
|
- Pull in upstream fixes
|
||||||
|
|
||||||
* Tue Jul 30 2019 Jan Grulich <jgrulich@redhat.com> - 1.1.0-2
|
* Tue Jul 30 2019 Jan Grulich <jgrulich@redhat.com> - 1.1.0-2
|
||||||
- Pull in upstream fixes
|
- Pull in upstream fixes
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user