Commit 25798a77 authored by Florian Blasius's avatar Florian Blasius 🤘

refactor default theme crate

parent bbcdf8d5
......@@ -4,17 +4,6 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Widgets native",
"program": "${workspaceFolder}/target/debug/examples/widgets",
"cwd": "${workspaceFolder}",
"preLaunchTask": "build",
"sourceLanguages": [
"rust"
]
},
{
"type": "lldb",
"request": "launch",
......@@ -26,62 +15,6 @@
"rust"
]
},
{
"type": "lldb",
"request": "launch",
"name": "Widgets pathfinder",
"program": "${workspaceFolder}/target/debug/examples/widgets",
"cwd": "${workspaceFolder}",
"preLaunchTask": "build pathfinder",
"sourceLanguages": [
"rust"
]
},
{
"type": "lldb",
"request": "launch",
"name": "Widgets browser",
"program": "cargo-node",
"cwd": "${workspaceFolder}",
"args": [
"run",
"--target",
"browser",
"--example",
"widgets"
],
"sourceLanguages": [
"rust"
]
},
{
"type": "lldb",
"request": "launch",
"name": "Widgets electron",
"program": "cargo-node",
"cwd": "${workspaceFolder}",
"args": [
"run",
"--target",
"electron",
"--example",
"widgets"
],
"sourceLanguages": [
"rust"
]
},
{
"type": "lldb",
"request": "launch",
"name": "Widgets debug",
"program": "${workspaceFolder}/target/debug/examples/widgets",
"cwd": "${workspaceFolder}",
"preLaunchTask": "build debug",
"sourceLanguages": [
"rust",
]
},
{
"type": "lldb",
"request": "launch",
......
......@@ -47,8 +47,6 @@ serde_derive = "1.0.106"
default = ["orbtk_shell/orbraq", "orbtk_api/orbraq", "orbtk_render/orbraq", "orbtk_widgets/orbraq", "orbtk_localization/ron"]
miniraq = ["orbtk_shell/miniraq", "orbtk_api/miniraq", "orbtk_widgets/miniraq", "orbtk_widgets/miniraq"]
log = ["orbtk_shell/log"]
light = ["orbtk_theme_default/light"]
redox = ["orbtk_theme_default/redox"]
debug = ["orbtk_api/debug"]
[workspace]
......
......@@ -63,10 +63,7 @@ impl Application {
request_sender: sender,
name: name.into(),
shell: Shell::new(receiver),
#[cfg(all(not(feature = "light"), not(feature = "redox")))]
theme: crate::theme_default::default_theme(),
#[cfg(feature = "light")]
theme: crate::theme_default::light_theme(),
theme: crate::theme_default::theme_default(),
localization: None,
}
}
......
......@@ -11,8 +11,4 @@ edition = "2018"
[dependencies]
orbtk_theming = { path = "../theming", version = "0.3.1-alpha4" }
lazy_static = "1.4.0"
[features]
light = []
redox = []
\ No newline at end of file
lazy_static = "1.4.0"
\ No newline at end of file
Theme (
styles: {
"base": (
properties: {
"font_size": "$FONT_SIZE_16",
"font": "$MEDIUM_FONT",
"icon_size": "$ICON_SIZE_16",
"icon_font": "$ICON_FONT",
},
),
"window": (
properties: {
"background": "$ALABASTER",
},
),
"body": (
properties: {
"foreground": "$BRIGHT_GRAY",
"font_size": "$FONT_SIZE_16",
"font": "$MEDIUM_FONT",
},
),
"header": (
base: "body",
properties: {
"font_size": "$FONT_SIZE_24",
}
),
"button": (
base: "base",
properties: {
"height": 36,
"foreground": "$BRIGHT_GRAY",
"icon_brush": "$BRIGHT_GRAY",
"background": "$ALTO",
"border_radius": 4,
},
states: {
"pressed": {
"background": "$SILVER_CHALICE",
},
"selected": {
"background": "$SILVER_CHALICE",
},
"disabled": {
"background": "$ROLLING_STONE",
"foreground": "$BRIGHT_GRAY",
"icon_brush": "$BRIGHT_GRAY",
},
"hover": {
"background": "$GREEN_SPRING"
}
},
),
"button_primary": (
base: "button",
properties: {
"background": "$GOLDEN_DREAM",
},
states: {
"hover": {
"background": "$GOLD_TIPS"
}
}
),
"button_small": (
properties: {
"border_radius": 0,
"icon_brush": "$BRIGHT_GRAY",
"font_size": "$ICON_SIZE_12",
"background": "transparent",
"height": 14,
"spacing": 0,
"padding": 0,
},
states: {
"pressed": {
"background": "$SILVER_CHALICE",
},
},
),
"button_square": (
base: "button",
properties: {
"border_radius": 1,
},
),
"button_single_content": (
base: "button",
properties: {
"spacing": 0,
},
),
"check_box": (
base: "base",
properties: {
"foreground": "$BRIGHT_GRAY",
"icon_size": "$ICON_SIZE_18",
"background": "transparent",
"border_radius": 2,
"border_width": 1,
"border_brush": "$SILVER_CHALICE",
"icon_brush": "transparent",
},
states: {
"selected": {
"background": "$GOLDEN_DREAM",
"border_brush": "$GOLDEN_DREAM",
"icon_brush": "$BRIGHT_GRAY",
},
},
),
"grid": (
base: "base",
properties: {
"background": "transparent",
},
),
"switch": (
properties: {
"width": 36,
"height": 32,
},
),
"switch_track": (
properties: {
"height": 14,
"border_radius": 7,
"background": "$SILVER_CHALICE",
}
),
"switch_toggle": (
properties: {
"width": 20,
"height": 20,
"border_radius": 10,
"background": "$ALTO",
},
states: {
"selected": {
"background": "$GOLDEN_DREAM",
},
},
),
"container": (
base: "base",
properties: {
"padding": 4,
},
),
"text_block_header": (
base: "base",
properties: {
"font_size": "$FONT_SIZE_24",
},
),
"text_box": (
base: "base",
properties: {
"height": 32,
"foreground": "$BRIGHT_GRAY",
"background": "$ALABASTER",
"border_brush": "$SILVER_CHALICE",
"border_width": 1,
"border_radius": 3,
"padding": 6,
},
states: {
"focused": {
"border_brush": "$SUNFLOWER",
},
"empty": {
"foreground": "$SILVER_CHALICE",
},
"empty_focused": {
"foreground": "$SILVER_CHALICE",
"border_brush": "$SUNFLOWER",
}
},
),
"numeric_box": (
base: "base",
properties: {
"height": 32,
"foreground": "$BRIGHT_GRAY",
"background": "$ALABASTER",
"border_brush": "$SILVER_CHALICE",
"border_width": 1,
"border_radius": 3,
"padding": 6,
},
states: {
"focused": {
"border_brush": "$SUNFLOWER",
}
},
),
"cursor": (
properties: {
"background": "$GOLD_TIPS",
"border_brush": "$GOLD_TIPS",
"border_width": 1
}
),
"slider": (
properties: {
"height": 24,
"border_radius": 2,
"background": "$SILVER_CHALICE",
}
),
"thumb": (
properties: {
"width": 24,
"height": 24,
"border_radius": 12,
"background": "$ALTO",
},
states: {
"pressed": {
"background": "$GOLDEN_DREAM",
},
},
),
"items_widget": (
properties: {
"background": "transparent",
"border_brush": "$SILVER_CHALICE",
"border_width": 1,
"border_radius": 2,
"padding": 4,
}
),
"small_text": (
base: "body",
properties: {
"font_size": "$FONT_SIZE_12",
"foreground": "$BRIGHT_GRAY",
},
),
"combo_box": (
base: "base",
properties: {
"foreground": "$BRIGHT_GRAY",
"icon_brush": "$BRIGHT_GRAY",
"background": "$ALABASTER",
"border_brush": "$SILVER_CHALICE",
"border_width": 1,
"border_radius": 3,
"padding": 6,
},
states: {
"selected": {
"border_brush": "$ENERGY_YELLOW",
},
},
),
"popup": (
properties: {
"background": "$WHITE",
"border_brush": "$LYNCH",
"border_width": 1,
"border_radius": 2,
},
),
"combo_box_item": (
properties: {
"font_size": "$FONT_SIZE_12",
"foreground": "$BRIGHT_GRAY",
"background": "transparent",
"padding_left": 8,
"padding_right": 8,
},
states: {
"selected": {
"foreground": "$BRIGHT_GRAY",
"background": "$SUNFLOWER",
},
"pressed": {
"foreground": "$BRIGHT_GRAY",
"background": "$SUNFLOWER",
},
},
),
"scroll_bar": (
properties: {
"background": "$ALTO",
"border_radius": 2,
},
),
"list_view": (
base: "base",
properties: {
"foreground": "$LINK_WATER",
"background": "transparent",
"border_brush": "$SILVER_CHALICE",
"border_width": 1,
"border_radius": 3,
},
),
"list_view_item": (
properties: {
"font_size": "$FONT_SIZE_12",
"foreground": "$BRIGHT_GRAY",
"background": "transparent",
"padding_left": 8,
"padding_right": 8,
},
states: {
"selected": {
"foreground": "$BRIGHT_GRAY",
"background": "$SUNFLOWER",
},
"pressed": {
"foreground": "$BRIGHT_GRAY",
"background": "$SUNFLOWER",
},
},
),
"progress_bar": (
properties: {
"background": "$WHITE",
"border_color": "$SILVER_CHALICE",
"border_radius": 4,
"border_width": 1,
"height": 16,
"padding": 2,
},
),
"progress_bar_indicator": (
properties: {
"background": "$GOLDEN_DREAM",
"height": 12,
"width": 0,
}
),
"tab_widget": (
properties: {
"border_brush": "$SILVER_CHALICE",
"border_width": 1,
"background": "transparent",
},
),
"tab_header": (
base: "base",
properties: {
"height": 32,
"font_sze": "$FONT_SIZE_12",
"foreground": "$BRIGHT_GRAY",
"background": "$ALTO",
"padding_left": 8,
"padding_right": 8,
"border_radius": 0
},
states: {
"selected": {
"background": "$ATHS_SPECIAL"
}
}
),
"tab_header_bar": (
properties: {
"background": "$GOLDEN_DREAM",
"height": 2
}
)
},
)
Theme (
resources: {
"BOTTICELLI": "#cfd6e6",
"HAVELOCK_BLUE": "#5294e2",
"ATHENS_GREY": "#f9f9fb"
},
)
\ No newline at end of file
Theme (
styles: {
"base": (
properties: {
"font_size": "$FONT_SIZE_16",
"font": "$MEDIUM_FONT",
"icon_size": "$ICON_SIZE_16",
"icon_font": "$ICON_FONT",
},
),
"window": (
properties: {
"background": "$ALABASTER",
},
),
"body": (
properties: {
"foreground": "$BRIGHT_GRAY",
"font_size": "$FONT_SIZE_16",
"font": "$MEDIUM_FONT",
},
),
"header": (
base: "body",
properties: {
"font_size": "$FONT_SIZE_24",
}
),
"button": (
base: "base",
properties: {
"height": 28,
"foreground": "$BLACK",
"icon_brush": "$BLACK",
"background": "$WHITE",
"border_brush": "$BOTTICELLI",
"border_width": 1,
"border_radius": 2,
"padding_left": 6,
"padding_right": 6,
"padding_top": 0,
"padding_bottom": 0
},
states: {
"pressed": {
"background": "$HAVELOCK_BLUE",
"icon_brush": "$WHITE",
"foreground": "$WHITE"
},
"selected": {
"background": "$HAVELOCK_BLUE",
"foreground": "$WHITE",
"icon_brush": "$WHITE"
},
"disabled": {
"background": "$ROLLING_STONE",
"foreground": "$BRIGHT_GRAY",
"icon_brush": "$BRIGHT_GRAY",
},
},
),
"button_primary": (
base: "button",
properties: {
"background": "$GOLDEN_DREAM",
},
),
"button_small": (
properties: {
"border_radius": 0,
"icon_brush": "$BRIGHT_GRAY",
"font_size": "$ICON_SIZE_12",
"background": "transparent",
"height": 14,
"spacing": 0,
"padding": 0,
},
states: {
"pressed": {
"background": "$SILVER_CHALICE",
},
},
),
"button_square": (
base: "button",
properties: {
"border_radius": 1,
},
),
"button_single_content": (
base: "button",
properties: {
"spacing": 0,
},
),
"check_box": (
base: "base",
properties: {
"foreground": "$BRIGHT_GRAY",
"icon_size": "$ICON_SIZE_18",
"background": "transparent",
"border_radius": 2,
"border_width": 1,
"border_brush": "$SILVER_CHALICE",
"icon_brush": "transparent",
},
states: {
"selected": {
"background": "$GOLDEN_DREAM",
"border_brush": "$GOLDEN_DREAM",
"icon_brush": "$BRIGHT_GRAY",
},
},
),