Skip to content

Commit

Permalink
Better workaround for LibreOffice menu check/radio buttons
Browse files Browse the repository at this point in the history
LibreOffice only uses Qt4 plugin (and is its only use) but that's done for Qt5 too.

Also made KvCommunitheme's menu text darker and gave the same weight to its bold texts.
  • Loading branch information
tsujan committed Apr 9, 2018
1 parent 97c89fd commit 0ca57e6
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Kvantum/NEWS
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Latest version:

9 Apr 2018, V0.10.6
10 Apr 2018, V0.10.6

See "ChangeLog" for changes.
6 changes: 3 additions & 3 deletions Kvantum/style/Kvantum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4547,7 +4547,7 @@ void Style::drawPrimitive(PrimitiveElement element,
suffix.append("-inactive");
if (isLibreoffice_ && suffix == "-checked-focused"
&& qstyleoption_cast<const QStyleOptionMenuItem*>(option))
painter->fillRect(option->rect, option->palette.brush(QPalette::Window));
painter->fillRect(option->rect, option->palette.brush(QPalette::Highlight));
QObject *styleObject = option->styleObject;
QString animationStartState;
if (styleObject)
Expand Down Expand Up @@ -4680,7 +4680,7 @@ void Style::drawPrimitive(PrimitiveElement element,
suffix.append("-inactive");
if (isLibreoffice_ && suffix == "-checked-focused"
&& qstyleoption_cast<const QStyleOptionMenuItem*>(option))
painter->fillRect(option->rect, option->palette.brush(QPalette::Window));
painter->fillRect(option->rect, option->palette.brush(QPalette::Highlight));
QObject *styleObject = option->styleObject;
QString animationStartState;
if (styleObject)
Expand Down Expand Up @@ -6935,7 +6935,7 @@ void Style::drawControl(ControlElement element,
Qt::AlignLeft | Qt::AlignVCenter,
QSize(iw,ih),
isLibreoffice_ ?
opt->rect.adjusted(2,-2,0,0) // FIXME why?
opt->rect.adjusted(qMax(-opt->rect.x(),0),-2,0,0) // FIXME why?
: interiorRect(opt->rect,fspec).adjusted(rtl ? 0 : lspec.left,
0,
rtl ? -lspec.right : 0,
Expand Down
6 changes: 3 additions & 3 deletions Kvantum/style/qt4/Kvantum4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3643,7 +3643,7 @@ void Style::drawPrimitive(PrimitiveElement element,
suffix.append("-inactive");
if (isLibreoffice_ && suffix == "-checked-focused"
&& qstyleoption_cast<const QStyleOptionMenuItem*>(option))
painter->fillRect(option->rect, option->palette.brush(QPalette::Window));
painter->fillRect(option->rect, option->palette.brush(QPalette::Highlight));
renderElement(painter, prefix+ispec.element+suffix, option->rect);
}
else
Expand Down Expand Up @@ -3704,7 +3704,7 @@ void Style::drawPrimitive(PrimitiveElement element,
suffix.append("-inactive");
if (isLibreoffice_ && suffix == "-checked-focused"
&& qstyleoption_cast<const QStyleOptionMenuItem*>(option))
painter->fillRect(option->rect, option->palette.brush(QPalette::Window));
painter->fillRect(option->rect, option->palette.brush(QPalette::Highlight));
renderElement(painter, prefix+ispec.element+suffix, option->rect);
}
else
Expand Down Expand Up @@ -5604,7 +5604,7 @@ void Style::drawControl(ControlElement element,
Qt::AlignLeft | Qt::AlignVCenter,
QSize(iw,ih),
isLibreoffice_ ?
opt->rect.adjusted(2,-2,0,0) // FIXME why?
opt->rect.adjusted(qMax(-opt->rect.x(),0),-2,0,0) // FIXME why?
: interiorRect(opt->rect,fspec).adjusted(rtl ? 0 : lspec.left,
0,
rtl ? -lspec.right : 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ text.margin.right=3
frame.expansion=14
min_height=+0.2font
min_width=+0.2font
text.boldness=2

[PanelButtonTool]
inherits=PanelButtonCommand
Expand Down Expand Up @@ -179,6 +180,7 @@ interior=false
text.normal.color=#3D3D3D
text.focus.color=#141414
text.bold=true
text.boldness=2
text.shadow=false
text.margin.top=2
text.margin.bottom=2
Expand Down Expand Up @@ -253,6 +255,7 @@ text.normal.color=#3D3D3D
text.press.color=#3D3D3D
text.focus.color=#141414
text.shadow=false
text.boldness=2

[Tab]
inherits=PanelButtonCommand
Expand Down Expand Up @@ -417,8 +420,8 @@ frame=true
frame.element=menuitem
interior.element=menuitem
indicator.element=menuitem
text.normal.color=#646464
text.focus.color=#5a5a5a
text.normal.color=#3D3D3D
text.focus.color=#3D3D3D
text.margin.top=2
text.margin.bottom=2
text.margin.left=12
Expand Down Expand Up @@ -465,6 +468,7 @@ indicator.element=mdi
text.normal.color=#d2d2d2
text.focus.color=#fcfcfc
text.bold=true
text.boldness=2
text.italic=true

[ComboBox]
Expand Down Expand Up @@ -495,6 +499,7 @@ frame.bottom=4
frame.left=4
frame.right=4
text.bold=true
text.boldness=2

[TabBarFrame]
inherits=PanelButtonCommand
Expand Down

0 comments on commit 0ca57e6

Please sign in to comment.