[vlc-commits] [Git][videolan/vlc][master] 3 commits: qt: make day and night theme tool button border color transparent

Steve Lhomme (@robUx4) gitlab at videolan.org
Fri Nov 15 15:21:51 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
5426b4bc by Fatih Uzunoglu at 2024-11-15T15:01:31+00:00
qt: make day and night theme tool button border color transparent

Since the button has no background, it looks fine without border. This
does not change behavior, because border color was not respected by
the tool button anyway.

- - - - -
f3ccd8b7 by Fatih Uzunoglu at 2024-11-15T15:01:31+00:00
qt: adjust blend factor in tool button border color in system palette

So that the border color does not stand out, and focus color and border
color are discernible.

- - - - -
39bad77f by Fatih Uzunoglu at 2024-11-15T15:01:31+00:00
qml: set border color when not focused in IconToolButton

- - - - -


3 changed files:

- modules/gui/qt/style/systempalette.cpp
- modules/gui/qt/style/systempalettethemeprovider.cpp
- modules/gui/qt/widgets/qml/IconToolButton.qml


Changes:

=====================================
modules/gui/qt/style/systempalette.cpp
=====================================
@@ -520,6 +520,11 @@ void SystemPalette::makeLightPalette()
         setColor(CS, C::Fg, C::Primary, C::Hovered, Qt::black);
         setColor(CS, C::Fg, C::Primary, C::Disabled, setColorAlpha(Qt::black, 0.2));
         setColor(CS, C::Fg, C::Secondary, C::Normal, Qt::black);
+
+        setColor(CS, C::Decoration, C::Border, C::Normal, Qt::transparent);
+        setColor(CS, C::Decoration, C::Border, C::Focused, Qt::transparent);
+        setColor(CS, C::Decoration, C::Border, C::Hovered, Qt::transparent);
+        setColor(CS, C::Decoration, C::Border, C::Disabled, Qt::transparent);
     }
 
     //menubar
@@ -718,6 +723,11 @@ void SystemPalette::makeDarkPalette()
         setColor(CS, C::Fg, C::Primary, C::Hovered, Qt::white);
         setColor(CS, C::Fg, C::Primary, C::Disabled, setColorAlpha(Qt::white, 0.2));
         setColor(CS, C::Fg, C::Secondary, C::Normal, Qt::white);
+
+        setColor(CS, C::Decoration, C::Border, C::Normal, Qt::transparent);
+        setColor(CS, C::Decoration, C::Border, C::Focused, Qt::transparent);
+        setColor(CS, C::Decoration, C::Border, C::Hovered, Qt::transparent);
+        setColor(CS, C::Decoration, C::Border, C::Disabled, Qt::transparent);
     }
 
     //menubar


=====================================
modules/gui/qt/style/systempalettethemeprovider.cpp
=====================================
@@ -121,12 +121,12 @@ static void setQtColorSetBg(vlc_qt_theme_provider_t* obj,
 }
 
 static void setQtColorSetBorder(vlc_qt_theme_provider_t* obj,
-    vlc_qt_theme_color_set set, QPalette::ColorRole roleBg, QPalette::ColorRole roleFg)
+    vlc_qt_theme_color_set set, QPalette::ColorRole roleBg, QPalette::ColorRole roleFg, float blend = 0.5)
 {
     auto sys = static_cast<SystemePaletteObserver*>(obj->p_sys);
     QColor fg = sys->m_palette.color(QPalette::Normal, roleFg);
     QColor bg = sys->m_palette.color(QPalette::Normal, roleBg);
-    setQtColor(obj, set, VQTC_SECTION_DECORATION, VQTC_NAME_BORDER, VQTC_STATE_NORMAL, blendColors(bg, fg));
+    setQtColor(obj, set, VQTC_SECTION_DECORATION, VQTC_NAME_BORDER, VQTC_STATE_NORMAL, blendColors(bg, fg, blend));
 }
 
 
@@ -237,7 +237,7 @@ static int updatePalette(vlc_qt_theme_provider_t* obj)
 
         setQtColor(obj, CS, VQTC_SECTION_FG, VQTC_NAME_SECONDARY, VQTC_STATE_NORMAL, secondaryTextButton);
 
-        setQtColorSetBorder(obj, CS, QPalette::Button, QPalette::ButtonText);
+        setQtColorSetBorder(obj, CS, QPalette::Button, QPalette::ButtonText, 0.8);
 
         setQtColor(obj, CS, VQTC_SECTION_BG, VQTC_NAME_NEGATIVE, VQTC_STATE_NORMAL, negative);
         setQtColor(obj, CS, VQTC_SECTION_BG, VQTC_NAME_NEGATIVE, VQTC_STATE_HOVERED, negativeHover);


=====================================
modules/gui/qt/widgets/qml/IconToolButton.qml
=====================================
@@ -97,7 +97,7 @@ T.ToolButton {
 
         color: control.backgroundColor
 
-        border.color: visualFocus ? theme.visualFocus : "transparent"
+        border.color: visualFocus ? theme.visualFocus : theme.border
     }
 
     contentItem: Widgets.IconLabel {



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/e8069e644ba244acf8913969f8054ef068555513...39bad77f43fd51c59150c734c6f7b1094fcab0d0

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/e8069e644ba244acf8913969f8054ef068555513...39bad77f43fd51c59150c734c6f7b1094fcab0d0
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list