mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-02 06:41:14 +00:00
Some work on the night mode coloring
This commit is contained in:
parent
e58749255d
commit
861cf74e73
3 changed files with 20 additions and 4 deletions
|
@ -10,11 +10,20 @@ LICENSE END */
|
||||||
|
|
||||||
export global DemoPalette := {
|
export global DemoPalette := {
|
||||||
// Color of the home/settings/ink buttons on the left side bar
|
// Color of the home/settings/ink buttons on the left side bar
|
||||||
property <color> active_page_icon_color: #122F7B;
|
property <color> active_page_icon_color: night_mode ? #6284FF : #122F7B;
|
||||||
property <color> inactive_page_icon_color: #BDC0D1;
|
property <color> inactive_page_icon_color: #BDC0D1;
|
||||||
|
|
||||||
property <color> main_background: #0E133F;
|
property <color> main_background: #0E133F;
|
||||||
|
|
||||||
|
property <color> page_background_color: night_mode ? #122F7B : white;
|
||||||
|
|
||||||
|
property <color> text_foreground_color: night_mode ? #F4F6FF : black;
|
||||||
|
|
||||||
|
property <color> printer_action_background_color: night_mode ? #0E133F : white;
|
||||||
|
|
||||||
property <bool> night_mode: false;
|
property <bool> night_mode: false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export Page := Rectangle {
|
||||||
|
background: DemoPalette.page_background_color;
|
||||||
|
}
|
|
@ -8,6 +8,8 @@
|
||||||
Please contact info@sixtyfps.io for more information.
|
Please contact info@sixtyfps.io for more information.
|
||||||
LICENSE END */
|
LICENSE END */
|
||||||
|
|
||||||
|
import { DemoPalette, Page } from "./common.60";
|
||||||
|
|
||||||
export struct PrinterAction := {
|
export struct PrinterAction := {
|
||||||
name: string,
|
name: string,
|
||||||
icon: resource,
|
icon: resource,
|
||||||
|
@ -17,15 +19,17 @@ ActionButton := Rectangle {
|
||||||
border-radius: 25px;
|
border-radius: 25px;
|
||||||
border-width: 5px;
|
border-width: 5px;
|
||||||
border-color: #FFBF63;
|
border-color: #FFBF63;
|
||||||
|
background: DemoPalette.printer_action_background_color;
|
||||||
property <resource> icon <=> img.source;
|
property <resource> icon <=> img.source;
|
||||||
|
|
||||||
img := Image {
|
img := Image {
|
||||||
x: (parent.width / 2) - (self.width / 2);
|
x: (parent.width / 2) - (self.width / 2);
|
||||||
y: (parent.height / 2) - (self.height / 2);
|
y: (parent.height / 2) - (self.height / 2);
|
||||||
|
colorize: DemoPalette.text_foreground_color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export HomePage := Rectangle {
|
export HomePage := Page {
|
||||||
property <[PrinterAction]> actions;
|
property <[PrinterAction]> actions;
|
||||||
|
|
||||||
property <length> header_row_height: 40px;
|
property <length> header_row_height: 40px;
|
||||||
|
@ -35,6 +39,7 @@ export HomePage := Rectangle {
|
||||||
font-weight: 900;
|
font-weight: 900;
|
||||||
font-size: 22px;
|
font-size: 22px;
|
||||||
width: 50%;
|
width: 50%;
|
||||||
|
color: DemoPalette.text_foreground_color;
|
||||||
}
|
}
|
||||||
|
|
||||||
property <length> button_spacing: root.width / 12;
|
property <length> button_spacing: root.width / 12;
|
||||||
|
@ -53,11 +58,12 @@ export HomePage := Rectangle {
|
||||||
width: 50%;
|
width: 50%;
|
||||||
|
|
||||||
border-radius: 27px;
|
border-radius: 27px;
|
||||||
background: #F4F6FF;
|
background: DemoPalette.night_mode ? DemoPalette.printer_action_background_color : #F4F6FF;
|
||||||
|
|
||||||
VerticalLayout {
|
VerticalLayout {
|
||||||
Text {
|
Text {
|
||||||
text: "Printing Queue";
|
text: "Printing Queue";
|
||||||
|
color: DemoPalette.text_foreground_color;
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
|
|
@ -64,7 +64,7 @@ MainWindow := Window {
|
||||||
main_view := Rectangle {
|
main_view := Rectangle {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
border-radius: 30px;
|
border-radius: 30px;
|
||||||
background: white;
|
background: DemoPalette.page_background_color;
|
||||||
minimum-width: 800px;
|
minimum-width: 800px;
|
||||||
minimum-height: 600px;
|
minimum-height: 600px;
|
||||||
|
|
||||||
|
@ -118,6 +118,7 @@ MainWindow := Window {
|
||||||
}
|
}
|
||||||
width: main_view.x - sidebar.x + 1px;
|
width: main_view.x - sidebar.x + 1px;
|
||||||
height: 1.5 * self.width;
|
height: 1.5 * self.width;
|
||||||
|
colorize: DemoPalette.page_background_color;
|
||||||
}
|
}
|
||||||
|
|
||||||
for page_icon[idx] in [
|
for page_icon[idx] in [
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue