feat(style): add window hover color
- 新增Window Hover颜色,解决类似网络托盘背景等类似显示问题
This commit is contained in:
parent
05c884b641
commit
484555f3ea
370
0001-feat-style-add-window-hover-color.patch
Normal file
370
0001-feat-style-add-window-hover-color.patch
Normal file
@ -0,0 +1,370 @@
|
||||
From ebe794510e8fef1be744778cd5ea366b6bf6b3f3 Mon Sep 17 00:00:00 2001
|
||||
From: liuxinhao <liuxinhao@kylinsec.com.cn>
|
||||
Date: Fri, 22 Jul 2022 15:25:15 +0800
|
||||
Subject: [PATCH] feat(style): add window hover color
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
- 新增Window Hover颜色,解决类似网络托盘背景等类似显示问题
|
||||
---
|
||||
style-helper/data/_functions.scss | 3 +
|
||||
style-helper/data/color-scheme/dark.colors | 1 +
|
||||
style-helper/data/color-scheme/light.colors | 1 +
|
||||
style-helper/data/qt5.scss | 137 ++++++++------------
|
||||
style/src/style.cpp | 2 +-
|
||||
5 files changed, 58 insertions(+), 86 deletions(-)
|
||||
|
||||
diff --git a/style-helper/data/_functions.scss b/style-helper/data/_functions.scss
|
||||
index be74dbb..dacdc7a 100644
|
||||
--- a/style-helper/data/_functions.scss
|
||||
+++ b/style-helper/data/_functions.scss
|
||||
@@ -157,6 +157,9 @@
|
||||
@if $c == background {
|
||||
@return $WindowBackgroundNormal;
|
||||
}
|
||||
+ @if $c == background-hover {
|
||||
+ @return $WindowBackgroundHover;
|
||||
+ }
|
||||
@if $c == foreground {
|
||||
@return $WindowForegroundNormal;
|
||||
}
|
||||
diff --git a/style-helper/data/color-scheme/dark.colors b/style-helper/data/color-scheme/dark.colors
|
||||
index 68aa236..abfb1f8 100644
|
||||
--- a/style-helper/data/color-scheme/dark.colors
|
||||
+++ b/style-helper/data/color-scheme/dark.colors
|
||||
@@ -57,6 +57,7 @@ ForegroundChecked=Default::Selection
|
||||
BackgroundNormal=Default::BackgroundNormal
|
||||
ForegroundNormal=Default::ForegroundNormal
|
||||
BorderNormal=Default::Border
|
||||
+BackgroundHover=mix(Window::BackgroundNormal, Window::ForegroundNormal, 0.9)
|
||||
|
||||
[Colors:Selection]
|
||||
BackgroundNormal=Default::Selection
|
||||
diff --git a/style-helper/data/color-scheme/light.colors b/style-helper/data/color-scheme/light.colors
|
||||
index e15e269..08b7604 100644
|
||||
--- a/style-helper/data/color-scheme/light.colors
|
||||
+++ b/style-helper/data/color-scheme/light.colors
|
||||
@@ -57,6 +57,7 @@ ForegroundChecked=Default::Selection
|
||||
BackgroundNormal=Default::BackgroundNormal
|
||||
ForegroundNormal=Default::ForegroundNormal
|
||||
BorderNormal=Default::Border
|
||||
+BackgroundHover=mix(Window::BackgroundNormal, Window::ForegroundNormal, 0.9)
|
||||
BackgroundAlternate=227,229,231
|
||||
|
||||
[Colors:Selection]
|
||||
diff --git a/style-helper/data/qt5.scss b/style-helper/data/qt5.scss
|
||||
index 39ad308..aa927d5 100644
|
||||
--- a/style-helper/data/qt5.scss
|
||||
+++ b/style-helper/data/qt5.scss
|
||||
@@ -73,6 +73,7 @@ $bare_foreground_backdrop_insensitive: #{"" + internal_insensitive(internal_back
|
||||
|
||||
// window
|
||||
$window_background_normal: #{"" + internal_window(background)};
|
||||
+$window_background_hover: #{"" + internal_window(background-hover)};
|
||||
$window_background_insensitive: #{"" + internal_insensitive(internal_window(background))};
|
||||
$window_background_backdrop: #{"" + internal_backdrop(internal_window(background))};
|
||||
$window_background_backdrop_insensitive: #{"" + internal_insensitive(internal_backdrop(internal_window(background)))};
|
||||
@@ -194,6 +195,10 @@ Window {
|
||||
Border: $window_border_normal;
|
||||
}
|
||||
|
||||
+Window:hover {
|
||||
+ Background: $window_background_hover;
|
||||
+}
|
||||
+
|
||||
Window:disabled {
|
||||
Background: $window_background_insensitive;
|
||||
Foreground: $window_foreground_insensitive;
|
||||
@@ -249,7 +254,7 @@ Widget:checked,
|
||||
Widget:selected {
|
||||
Background: $widget_background_checked;
|
||||
Foreground: $widget_foreground_checked;
|
||||
- Border: $widget_border_focus;
|
||||
+ Border: $widget_border_focus;
|
||||
}
|
||||
|
||||
Widget:disabled {
|
||||
@@ -301,220 +306,182 @@ TitleBar:disabled {
|
||||
|
||||
|
||||
/** --- 提供给KiranStyle直接使用的相关属性 --- **/
|
||||
-Frame
|
||||
-{
|
||||
+Frame {
|
||||
Background: $window_background_normal;
|
||||
Border: $window_border_normal;
|
||||
}
|
||||
|
||||
-Frame:disabled
|
||||
-{
|
||||
+Frame:disabled {
|
||||
Background: $window_background_insensitive;
|
||||
Border: $window_border_insensitive;
|
||||
}
|
||||
|
||||
-Button
|
||||
-{
|
||||
+Button {
|
||||
Background: $widget_background_normal;
|
||||
Border: $widget_border_normal;
|
||||
}
|
||||
|
||||
-Button:hover
|
||||
-{
|
||||
+Button:hover {
|
||||
Background: $widget_background_hover;
|
||||
}
|
||||
|
||||
-Button:pressed
|
||||
-{
|
||||
+Button:pressed {
|
||||
Background: $widget_background_active;
|
||||
}
|
||||
|
||||
-Button:disabled
|
||||
-{
|
||||
+Button:disabled {
|
||||
Background: $widget_background_insensitive;
|
||||
Border: $widget_border_insensitive;
|
||||
}
|
||||
|
||||
-SpecialButton
|
||||
-{
|
||||
- DefaultBackground:$special_button_default_normal;
|
||||
- WarnningBackground:$special_button_warnning_normal;
|
||||
+SpecialButton {
|
||||
+ DefaultBackground: $special_button_default_normal;
|
||||
+ WarnningBackground: $special_button_warnning_normal;
|
||||
}
|
||||
|
||||
-SpecialButton:hover
|
||||
-{
|
||||
- DefaultBackground:$special_button_default_hover;
|
||||
- WarnningBackground:$special_button_warnning_hover;
|
||||
+SpecialButton:hover {
|
||||
+ DefaultBackground: $special_button_default_hover;
|
||||
+ WarnningBackground: $special_button_warnning_hover;
|
||||
}
|
||||
|
||||
-SpecialButton:pressed
|
||||
-{
|
||||
- DefaultBackground:$special_button_default_active;
|
||||
- WarnningBackground:$special_button_warnning_active;
|
||||
+SpecialButton:pressed {
|
||||
+ DefaultBackground: $special_button_default_active;
|
||||
+ WarnningBackground: $special_button_warnning_active;
|
||||
}
|
||||
|
||||
-SpecialButton:disabled
|
||||
-{
|
||||
- DefaultBackground:$special_button_default_insensitive;
|
||||
- WarnningBackground:$special_button_warnning_insensitive;
|
||||
+SpecialButton:disabled {
|
||||
+ DefaultBackground: $special_button_default_insensitive;
|
||||
+ WarnningBackground: $special_button_warnning_insensitive;
|
||||
}
|
||||
|
||||
-Edit
|
||||
-{
|
||||
+Edit {
|
||||
Background: $view_background_normal;
|
||||
Foreground: $view_foreground_normal;
|
||||
Border: $view_border_normal;
|
||||
}
|
||||
|
||||
-Edit:focus
|
||||
-{
|
||||
+Edit:focus {
|
||||
Border: $view_border_focus;
|
||||
}
|
||||
|
||||
-Edit:disabled
|
||||
-{
|
||||
+Edit:disabled {
|
||||
Background: $view_background_insensitive;
|
||||
Border: $view_border_insensitive;
|
||||
}
|
||||
|
||||
-Indicator
|
||||
-{
|
||||
+Indicator {
|
||||
Arrow: $widget_foreground_normal;
|
||||
}
|
||||
|
||||
-Indicator:disabled
|
||||
-{
|
||||
+Indicator:disabled {
|
||||
Arrow: $widget_foreground_insensitive;
|
||||
}
|
||||
|
||||
-Combo
|
||||
-{
|
||||
+Combo {
|
||||
Background: transparent;
|
||||
Border: $widget_border_normal;
|
||||
}
|
||||
|
||||
-Combo:hover
|
||||
-{
|
||||
+Combo:hover {
|
||||
Background: $widget_background_hover;
|
||||
}
|
||||
|
||||
-Combo:pressed
|
||||
-{
|
||||
+Combo:pressed {
|
||||
Background: $widget_background_active;
|
||||
}
|
||||
|
||||
-Combo:disabled
|
||||
-{
|
||||
+Combo:disabled {
|
||||
Background: $widget_background_insensitive;
|
||||
Border: $widget_border_insensitive;
|
||||
}
|
||||
|
||||
-ItemView
|
||||
-{
|
||||
+ItemView {
|
||||
Branch: $widget_border_normal;
|
||||
}
|
||||
|
||||
-ItemView:disabled
|
||||
-{
|
||||
+ItemView:disabled {
|
||||
Branch: $widget_border_insensitive;
|
||||
}
|
||||
|
||||
-MenuBar
|
||||
-{
|
||||
+MenuBar {
|
||||
ItemBackground: $window_background_normal;
|
||||
EmptyAreaBackground: $window_background_normal;
|
||||
}
|
||||
|
||||
-MenuBar:hover
|
||||
-{
|
||||
+MenuBar:hover {
|
||||
ItemBackground: $widget_background_hover;
|
||||
}
|
||||
|
||||
-MenuBar:pressed
|
||||
-{
|
||||
+MenuBar:pressed {
|
||||
ItemBackground: $widget_background_active;
|
||||
}
|
||||
|
||||
-MenuBar:disabled
|
||||
-{
|
||||
+MenuBar:disabled {
|
||||
ItemBackground: $window_background_insensitive;
|
||||
EmptyAreaBackground: $window_background_insensitive;
|
||||
}
|
||||
|
||||
-Progress
|
||||
-{
|
||||
+Progress {
|
||||
Groove: $bare_background_normal;
|
||||
Content: $bare_foreground_checked;
|
||||
}
|
||||
|
||||
-Progress:disabled
|
||||
-{
|
||||
+Progress:disabled {
|
||||
Groove: $bare_background_insensitive;
|
||||
Content: $bare_foreground_insensitive;
|
||||
}
|
||||
|
||||
-Scroll
|
||||
-{
|
||||
+Scroll {
|
||||
Slider: $bare_background_normal;
|
||||
}
|
||||
|
||||
-Scroll:hover
|
||||
-{
|
||||
+Scroll:hover {
|
||||
Slider: $bare_background_hover;
|
||||
}
|
||||
|
||||
-Scroll:pressed
|
||||
-{
|
||||
+Scroll:pressed {
|
||||
Slider: $bare_background_checked;
|
||||
}
|
||||
|
||||
-Scroll:disabled
|
||||
-{
|
||||
+Scroll:disabled {
|
||||
Slider: $bare_background_insensitive;
|
||||
}
|
||||
|
||||
-Slider
|
||||
-{
|
||||
+Slider {
|
||||
Groove: $bare_background_normal;
|
||||
Content: $bare_foreground_checked;
|
||||
HandleBorder: white;
|
||||
HandleBackground: $bare_foreground_checked;
|
||||
}
|
||||
|
||||
-Slider:pressed
|
||||
-{
|
||||
+Slider:pressed {
|
||||
HandleBorder: white;
|
||||
HandleBackground: white;
|
||||
}
|
||||
|
||||
-Slider:disabled
|
||||
-{
|
||||
+Slider:disabled {
|
||||
Groove: $bare_background_insensitive;
|
||||
Content: $bare_foreground_insensitive;
|
||||
HandleBorder: $bare_foreground_insensitive;
|
||||
HandleBackground: $bare_foreground_insensitive;
|
||||
}
|
||||
|
||||
-SpinBox
|
||||
-{
|
||||
+SpinBox {
|
||||
Background: $widget_background_normal;
|
||||
Border: $widget_border_normal;
|
||||
SignColor: $widget_foreground_normal;
|
||||
}
|
||||
|
||||
-SpinBox:hover
|
||||
-{
|
||||
+SpinBox:hover {
|
||||
Background: $widget_background_hover;
|
||||
Border: $widget_border_hover;
|
||||
}
|
||||
|
||||
-SpinBox:pressed
|
||||
-{
|
||||
+SpinBox:pressed {
|
||||
Background: $widget_background_active;
|
||||
}
|
||||
|
||||
-SpinBox:disabled
|
||||
-{
|
||||
+SpinBox:disabled {
|
||||
Background: $widget_background_insensitive;
|
||||
Border: $widget_border_insensitive;
|
||||
SignColor: $widget_foreground_insensitive;
|
||||
diff --git a/style/src/style.cpp b/style/src/style.cpp
|
||||
index fa0741b..01ca5e8 100644
|
||||
--- a/style/src/style.cpp
|
||||
+++ b/style/src/style.cpp
|
||||
@@ -64,7 +64,7 @@ QDebug operator<<(QDebug dbg, const QColor &color)
|
||||
|
||||
using namespace Kiran;
|
||||
|
||||
-//FIXME:为什么加入namespace,导致crash
|
||||
+//FIXME:由于kiran-widgets-qt5之前包含的Kiran::Style重名导致现在暂时不能加入Kiran命名控件,否则将引起崩溃
|
||||
Style::Style()
|
||||
: ParentStyle()
|
||||
{
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -1,13 +1,14 @@
|
||||
Name: kiran-qt5-integration
|
||||
Version: 2.3.0
|
||||
Release: 2
|
||||
Release: 3
|
||||
Summary: Kiran desktop platform integration plugin.
|
||||
|
||||
License: Mulan PSL v2
|
||||
License: MulanPSL-2.0
|
||||
Source0: %{name}-%{version}.tar.gz
|
||||
|
||||
Patch0001: 0001-refactor-log-Reduce-some-log-output-levels.patch
|
||||
Patch0002: 0002-feat-style-new-file-interface-that-can-disable-Kiran.patch
|
||||
Patch0003: 0001-feat-style-add-window-hover-color.patch
|
||||
|
||||
BuildRequires: cmake >= 3.2
|
||||
BuildRequires: gcc-c++
|
||||
@ -63,6 +64,9 @@ make %{?_smp_mflags}
|
||||
%{_libdir}/pkgconfig/kiran-style-helper.pc
|
||||
|
||||
%changelog
|
||||
* Thu Aug 04 2022 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.3.0-3
|
||||
- KYOS-F: add window hover color
|
||||
|
||||
* Mon Jul 11 2022 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.3.0-2
|
||||
- KYOS-F: reduce some log level,disable kiranstyle settings file
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user