From 0d5a9b270d4b27715458d35f38ef7c04c7800240 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig=20Bj=C3=B8rlykke?= Date: Wed, 24 Apr 2019 10:20:30 +0200 Subject: [PATCH] Qt: Remove the border around inactive+selected packet list items MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It was a bad idea to bring back the border around inactive+selected packet list items in g009283a6 because it will move the text some pixels down. Revert this part because we now have support for customize the colors. Remove the old "style_inactive_selected" handling because it has no effect. Change-Id: I7599591a957a11d42964f7dc0981411cf3b28b4f Reviewed-on: https://code.wireshark.org/review/32964 Petri-Dish: Stig Bjørlykke Tested-by: Petri Dish Buildbot Reviewed-by: Stig Bjørlykke --- ui/qt/packet_list.cpp | 41 ----------------------------------------- 1 file changed, 41 deletions(-) diff --git a/ui/qt/packet_list.cpp b/ui/qt/packet_list.cpp index 3623734a50..4b4051f425 100644 --- a/ui/qt/packet_list.cpp +++ b/ui/qt/packet_list.cpp @@ -317,16 +317,6 @@ void PacketList::colorsChanged() QString active_style = QString(); QString inactive_style = QString(); - bool style_inactive_selected = true; - -#ifdef Q_OS_WIN // && Qt version >= 4.8.6 - if (QSysInfo::windowsVersion() < QSysInfo::WV_WINDOWS8) { - if (IsAppThemed() && IsThemeActive()) { - style_inactive_selected = false; - } - } -#endif - if (prefs.gui_active_style == COLOR_STYLE_DEFAULT) { // ACTIVE = Default } else if (prefs.gui_active_style == COLOR_STYLE_FLAT) { @@ -354,37 +344,6 @@ void PacketList::colorsChanged() // INACTIVE style sheet settings if (prefs.gui_inactive_style == COLOR_STYLE_DEFAULT) { // INACTIVE = Default - if (style_inactive_selected) { - QPalette inactive_pal = palette(); - inactive_pal.setCurrentColorGroup(QPalette::Inactive); - QColor border = QColor::fromRgb(ColorUtils::alphaBlend( - inactive_pal.highlightedText(), - inactive_pal.highlight(), - 0.25)); - QColor shadow = QColor::fromRgb(ColorUtils::alphaBlend( - inactive_pal.highlightedText(), - inactive_pal.highlight(), - 0.07)); - inactive_style = QString( - "QTreeView::item:selected:first:!active {" - " border-left: 1px solid %1;" - "}" - "QTreeView::item:selected:last:!active {" - " border-right: 1px solid %1;" - "}" - "QTreeView::item:selected:!active {" - " border-top: 1px solid %1;" - " border-bottom: 1px solid %1;" - " color: %2;" - // Try to approximate a subtle box shadow. - " background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1" - " stop: 0 %4, stop: 0.2 %3, stop: 0.8 %3, stop: 1 %4);" - "}") - .arg(border.name()) - .arg(inactive_pal.highlightedText().color().name()) - .arg(inactive_pal.highlight().color().name()) - .arg(shadow.name()); - } } else if (prefs.gui_inactive_style == COLOR_STYLE_FLAT) { // INACTIVE = Flat QColor foreground = ColorUtils::fromColorT(prefs.gui_inactive_fg);