Fix theming with Qt 5.15

* Fixes #4765
* Fixes #4766
This commit is contained in:
Jonathan White
2020-06-04 08:10:43 -04:00
parent 6f5e13815c
commit 2073f2ddc3
11 changed files with 149 additions and 128 deletions

View File

@@ -397,7 +397,6 @@ namespace Phantom
colors[S_button] = Dc::adjustLightness(colors[S_button], 0.01);
colors[S_base] = pal.color(QPalette::Base);
colors[S_text] = pal.color(QPalette::Text);
colors[S_text] = pal.color(QPalette::WindowText);
colors[S_windowText] = pal.color(QPalette::WindowText);
colors[S_highlight] = pal.color(QPalette::Highlight);
colors[S_highlightedText] = pal.color(QPalette::HighlightedText);
@@ -4622,11 +4621,13 @@ int BaseStyle::styleHint(StyleHint hint,
case SH_Table_GridLineColor: {
using namespace Phantom::SwatchColors;
namespace Ph = Phantom;
if (!option)
return 0;
auto ph_swatchPtr = Ph::getCachedSwatchOfQPalette(&d->swatchCache, &d->headSwatchFastKey, option->palette);
const Ph::PhSwatch& swatch = *ph_swatchPtr.data();
// Qt code in table views for drawing grid lines is broken. See case for
// CE_ItemViewItem painting for more information.
return option ? static_cast<int>(swatch.color(S_base_divider).rgb()) : 0;
return static_cast<int>(swatch.color(S_base_divider).rgb());
}
case SH_MessageBox_TextInteractionFlags:
return Qt::TextSelectableByMouse | Qt::LinksAccessibleByMouse;