modular ui rework

This commit is contained in:
galister
2024-02-25 19:27:48 +01:00
parent b93ddfce5b
commit b045f46b12
20 changed files with 2161 additions and 1049 deletions

519
src/res/settings.yaml Normal file
View File

@@ -0,0 +1,519 @@
# lookng to make changes?
# drop me in ~/.config/wlxoverlay.settings.yaml
#
# i will likely change this later. edit with that in mind
width: 0.3
size: [600, 520]
# +X: right, +Y: up, +Z: back
spawn_pos: [0, -0.1, -0.5]
elements:
- type: Panel
rect: [0, 0, 600, 800]
bg_color: "#102030"
- type: Label
rect: [15, 35, 600, 70]
font_size: 24
fg_color: "#ffffff"
source: Static
text: Settings
- type: Button
rect: [560, 0, 40, 40]
font_size: 16
bg_color: "#880000"
fg_color: "#ffffff"
text: X
click_down:
- type: Window
target: "settings"
action: Destroy
- type: Panel
rect: [50, 53, 500, 1]
bg_color: "#c0c0c0"
####### Watch Section #######
- type: Label
rect: [15, 85, 570, 24]
font_size: 18
fg_color: "#ffffff"
source: Static
text: Watch
- type: Panel
rect: [250, 105, 1, 100]
bg_color: "#c0c0c0"
- type: Label
rect: [288, 105, 100, 24]
font_size: 12
fg_color: "#ffffff"
source: Static
text: Visibility
- type: Button
rect: [270, 120, 100, 30]
font_size: 12
fg_color: "#ffffff"
bg_color: "#306060"
text: "Hide"
click_down:
- type: Watch
action: Hide
- type: Button
rect: [270, 170, 100, 30]
font_size: 12
fg_color: "#ffffff"
bg_color: "#306060"
text: "Swap Hand"
click_down:
- type: Watch
action: SwitchHands
- type: Panel
rect: [390, 105, 1, 100]
bg_color: "#c0c0c0"
- type: Label
rect: [430, 105, 120, 24]
font_size: 12
fg_color: "#ffffff"
source: Static
text: Watch Fade
- type: Button
rect: [410, 120, 140, 30]
font_size: 12
fg_color: "#ffffff"
bg_color: "#306060"
text: "Cutoff Point"
click_down:
- type: Toast
message: Use stick up/down while hovering the button!
scroll_up:
- type: Watch
action:
ViewAngle: {kind: "MaxOpacity", delta: 0.01}
scroll_down:
- type: Watch
action:
ViewAngle: {kind: "MaxOpacity", delta: -0.01}
- type: Button
rect: [410, 170, 140, 30]
font_size: 12
fg_color: "#ffffff"
bg_color: "#306060"
text: "Cutoff Strength"
click_down:
- type: Toast
message: Use stick up/down while hovering the button!
scroll_up:
- type: Watch
action:
ViewAngle: {kind: "MinOpacity", delta: 0.01}
scroll_down:
- type: Watch
action:
ViewAngle: {kind: "MinOpacity", delta: -0.01}
- type: Label
rect: [25, 140, 90, 30]
font_size: 12
fg_color: "#ffffff"
source: Static
text: Rotation
- type: Button
rect: [108, 120, 30, 30]
font_size: 12
fg_color: "#ffffff"
bg_color: "#306060"
text: "X"
click_down:
- type: Toast
message: Use stick up/down while hovering the button!
scroll_up:
- type: Watch
action:
Rotation: {axis: "X", delta: 0.25}
scroll_down:
- type: Watch
action:
Rotation: {axis: "X", delta: -0.25}
- type: Button
rect: [153, 120, 30, 30]
font_size: 12
fg_color: "#ffffff"
bg_color: "#306060"
text: "Y"
click_down:
- type: Toast
message: Use stick up/down while hovering the button!
scroll_up:
- type: Watch
action:
Rotation: {axis: "Y", delta: 0.25}
scroll_down:
- type: Watch
action:
Rotation: {axis: "Y", delta: -0.25}
- type: Button
rect: [198, 120, 30, 30]
font_size: 12
fg_color: "#ffffff"
bg_color: "#306060"
text: "Z"
click_down:
- type: Toast
message: Use stick up/down while hovering the button!
scroll_up:
- type: Watch
action:
Rotation: {axis: "Z", delta: 0.25}
scroll_down:
- type: Watch
action:
Rotation: {axis: "Z", delta: -0.25}
- type: Label
rect: [25, 190, 90, 30]
font_size: 12
fg_color: "#ffffff"
source: Static
text: Position
- type: Button
rect: [108, 170, 30, 30]
font_size: 12
fg_color: "#ffffff"
bg_color: "#306060"
text: "X"
click_down:
- type: Toast
message: Use stick up/down while hovering the button!
scroll_up:
- type: Watch
action:
Position: {axis: "X", delta: 0.001}
scroll_down:
- type: Watch
action:
Position: {axis: "X", delta: -0.001}
- type: Button
rect: [153, 170, 30, 30]
font_size: 12
fg_color: "#ffffff"
bg_color: "#306060"
text: "Y"
click_down:
- type: Toast
message: Use stick up/down while hovering the button!
scroll_up:
- type: Watch
action:
Position: {axis: "Y", delta: 0.001}
scroll_down:
- type: Watch
action:
Position: {axis: "Y", delta: -0.001}
- type: Button
rect: [198, 170, 30, 30]
font_size: 12
fg_color: "#ffffff"
bg_color: "#306060"
text: "Z"
click_down:
- type: Toast
message: Use stick up/down while hovering the button!
scroll_up:
- type: Watch
action:
Position: {axis: "Z", delta: 0.001}
scroll_down:
- type: Watch
action:
Position: {axis: "Z", delta: -0.001}
- type: Panel
rect: [50, 220, 500, 1]
bg_color: "#c0c0c0"
####### Mirror Section #######
- type: Label
rect: [15, 255, 570, 24]
font_size: 18
fg_color: "#ffffff"
source: Static
text: Mirrors
- type: Label
rect: [25, 290, 30, 30]
font_size: 12
fg_color: "#ffffff"
source: Static
text: M1
- type: Button
rect: [60, 270, 110, 30]
font_size: 12
fg_color: "#ffffff"
bg_color: "#707070"
text: "Show/Hide"
click_down:
- type: Window
target: M1
action: ShowMirror
- type: Button
rect: [185, 270, 60, 30]
font_size: 12
fg_color: "#ffffff"
bg_color: "#707070"
text: "Lock"
click_down:
- type: Overlay
target: M1
action: ToggleInteraction
- type: Button
rect: [258, 270, 30, 30]
font_size: 12
fg_color: "#ffffff"
bg_color: "#880000"
text: "X"
click_down:
- type: Window
target: M1
action: Destroy
- type: Label
rect: [25, 340, 30, 30]
font_size: 12
fg_color: "#ffffff"
source: Static
text: M2
- type: Button
rect: [60, 320, 110, 30]
font_size: 12
fg_color: "#ffffff"
bg_color: "#707070"
text: "Show/Hide"
click_down:
- type: Window
target: M2
action: ShowMirror
- type: Button
rect: [185, 320, 60, 30]
font_size: 12
fg_color: "#ffffff"
bg_color: "#707070"
text: "Lock"
click_down:
- type: Overlay
target: M2
action: ToggleInteraction
- type: Button
rect: [258, 320, 30, 30]
font_size: 12
fg_color: "#ffffff"
bg_color: "#880000"
text: "X"
click_down:
- type: Window
target: M2
action: Destroy
- type: Label
rect: [25, 390, 30, 30]
font_size: 12
fg_color: "#ffffff"
source: Static
text: M3
- type: Button
rect: [60, 370, 110, 30]
font_size: 12
fg_color: "#ffffff"
bg_color: "#707070"
text: "Show/Hide"
click_down:
- type: Window
target: M3
action: ShowMirror
- type: Button
rect: [185, 370, 60, 30]
font_size: 12
fg_color: "#ffffff"
bg_color: "#707070"
text: "Lock"
click_down:
- type: Overlay
target: M3
action: ToggleInteraction
- type: Button
rect: [258, 370, 30, 30]
font_size: 12
fg_color: "#ffffff"
bg_color: "#880000"
text: "X"
click_down:
- type: Window
target: M3
action: Destroy
- type: Panel
rect: [300, 240, 1, 200]
bg_color: "#c0c0c0"
####### Color Gain Section #######
- type: Label
rect: [325, 255, 90, 24]
font_size: 18
fg_color: "#ffffff"
source: Static
text: Color Gain
- type: Label
rect: [470, 255, 90, 30]
font_size: 12
fg_color: "#ffffff"
source: Static
text: (SteamVR)
- type: Button
rect: [330, 270, 60, 30]
font_size: 12
fg_color: "#ffffff"
bg_color: "#707070"
text: "All"
click_down:
- type: Toast
message: Use stick up/down while hovering the button!
scroll_up:
- type: ColorAdjust
channel: All
delta: 0.01
scroll_down:
- type: ColorAdjust
channel: All
delta: -0.01
- type: Button
rect: [405, 270, 30, 30]
font_size: 12
fg_color: "#ffffff"
bg_color: "#701010"
text: "R"
click_down:
- type: Toast
message: Use stick up/down while hovering the button!
scroll_up:
- type: ColorAdjust
channel: R
delta: 0.01
scroll_down:
- type: ColorAdjust
channel: R
delta: -0.01
- type: Button
rect: [450, 270, 30, 30]
font_size: 12
fg_color: "#ffffff"
bg_color: "#107010"
text: "G"
click_down:
- type: Toast
message: Use stick up/down while hovering the button!
scroll_up:
- type: ColorAdjust
channel: G
delta: 0.01
scroll_down:
- type: ColorAdjust
channel: G
delta: -0.01
- type: Button
rect: [495, 270, 30, 30]
font_size: 12
fg_color: "#ffffff"
bg_color: "#101070"
text: "B"
click_down:
- type: Toast
message: Use stick up/down while hovering the button!
scroll_up:
- type: ColorAdjust
channel: B
delta: 0.01
scroll_down:
- type: ColorAdjust
channel: B
delta: -0.01
- type: Panel
rect: [325, 315, 225, 1]
bg_color: "#c0c0c0"
####### Playspace Section #######
- type: Label
rect: [325, 345, 90, 24]
font_size: 18
fg_color: "#ffffff"
source: Static
text: Playspace
- type: Button
rect: [330, 360, 220, 30]
font_size: 12
fg_color: "#ffffff"
bg_color: "#206060"
text: "Fix Floor"
click_down:
- type: System
action: PlayspaceFixFloor
- type: Button
rect: [330, 410, 220, 30]
font_size: 12
fg_color: "#ffffff"
bg_color: "#206060"
text: "Reset Offset"
click_down:
- type: System
action: PlayspaceResetOffset
- type: Panel
rect: [50, 460, 500, 1]
bg_color: "#c0c0c0"
- type: Button
rect: [330, 480, 220, 30]
font_size: 12
fg_color: "#ffffff"
bg_color: "#206060"
text: "Save Config"
click_down:
- type: System
action: PersistConfig

View File

@@ -1,61 +1,61 @@
# Tips for optimization:
# - try to re-use font sizes, every loaded font size uses additional VRAM.
# common properties:
# - rect: bounding rectangle [x, y, width, height]
# (x, y) = (0, 0) is top-left
# - bg_color: background color of panels and buttons
# - fg_color: color of text
# lookng to make changes?
# drop me in ~/.config/wlxoverlay.settings.yaml
#
# element types:
# panel - simple colored rectangle
# rect: bounding rectangle
# bg_color: color of rectangle. quotation marks mandatory.
#
# clock - date/time display with custom formatting
# rect: bounding rectangle
# fg_color: color of text. quotation marks mandatory.
# format: chrono format to print, see https://docs.rs/chrono/latest/chrono/format/strftime/index.html
# timezone: timezone to use, leave empty for local
# render resolution of the watch
width: 0.115
watch_view_angle: 0.5 # 0 = 90 deg, 1 = 0 deg
size: [400, 200]
# TODO
watch_hand: Left
# TODO
watch_offset: []
# TODO
watch_rotation: []
# TODO
watch_size: [400, 200]
watch_elements:
elements:
# background panel
- type: Panel
rect: [0, 0, 400, 200]
bg_color: "#353535"
- type: FuncButton
- type: Button
rect: [2, 162, 26, 36]
font_size: 14
bg_color: "#808040"
fg_color: "#ffffff"
func: SwitchWatchHand
func_right: HideWatch
func_middle: ~
text: "W"
text: "C"
click_up:
- type: Window
target: settings
action: ShowUi
- type: KeyboardButton
# Keyboard button
- type: Button
rect: [32, 162, 60, 36]
font_size: 14
fg_color: "#FFFFFF"
bg_color: "#406050"
text: "Kbd"
text: Kbd
click_up:
- type: Overlay
target: "kbd"
action: ToggleVisible
long_click_up:
- type: Overlay
target: "kbd"
action: Reset
right_up:
- type: Overlay
target: "kbd"
action: ToggleImmovable
middle_up:
- type: Overlay
target: "kbd"
action: ToggleInteraction
scroll_up:
- type: Overlay
target: "kbd"
action:
Opacity: { delta: 0.025 }
scroll_down:
- type: Overlay
target: "kbd"
action:
Opacity: { delta: -0.025 }
# bottom row, of keyboard + overlays
- type: OverlayList
@@ -64,109 +64,100 @@ watch_elements:
fg_color: "#FFFFFF"
bg_color: "#405060"
layout: Horizontal
click_up: ToggleVisible
long_click_up: Reset
right_up: ToggleImmovable
middle_up: ToggleInteraction
scroll_up:
Opacity: { delta: 0.025 }
scroll_down:
Opacity: { delta: -0.025 }
# main clock with date and day-of-week
- type: Clock
# local clock
- type: Label
rect: [19, 90, 200, 50]
#format: "%h:%M %p" # 11:59 PM
format: "%H:%M" # 23:59
font_size: 46
fg_color: "#ffffff"
- type: Clock
source: Clock
format: "%H:%M" # 23:59
#format: "%h:%M %p" # 11:59 PM
# local date
- type: Label
rect: [20, 117, 200, 20]
font_size: 14
fg_color: "#ffffff"
source: Clock
format: "%x" # local date representation
font_size: 14
fg_color: "#ffffff"
- type: Clock
# local day-of-week
- type: Label
rect: [20, 137, 200, 50]
#format: "%a" # Tue
format: "%A" # Tuesday
font_size: 14
fg_color: "#ffffff"
source: Clock
format: "%A" # Tuesday
#format: "%a" # Tue
# alt clock 1
- type: Clock
- type: Label
rect: [210, 90, 200, 50]
timezone: "Asia/Tokyo" # change TZ1 here
format: "%H:%M"
font_size: 24
fg_color: "#99BBAA"
source: Clock
timezone: "Asia/Tokyo" # change TZ1 here
format: "%H:%M" # 23:59
#format: "%h:%M %p" # 11:59 PM
- type: Label
rect: [210, 60, 200, 50]
font_size: 14
fg_color: "#99BBAA"
source: Static
text: "Tokyo" # change TZ1 label here
# alt clock 2
- type: Clock
- type: Label
rect: [210, 150, 200, 50]
timezone: "America/Chicago" # change TZ2 here
format: "%H:%M"
font_size: 24
fg_color: "#AA99BB"
source: Clock
timezone: "America/Chicago" # change TZ2 here
format: "%H:%M" # 23:59
#format: "%h:%M %p" # 11:59 PM
- type: Label
rect: [210, 120, 200, 50]
font_size: 14
fg_color: "#AA99BB"
source: Static
text: "Chicago" # change TZ2 label here
- type: Batteries
# batteries
- type: BatteryList
rect: [0, 0, 400, 30]
font_size: 14
fg_color: "#99BBAA"
fg_color_low: "#B06060"
fg_color_charging: "#6080A0"
num_devices: 9
low_threshold: 20
layout: Horizontal
normal_fg_color: "#99BBAA"
# below is not yet implemented
normal_bg_color: "#353535"
low_fg_color: "#B06060"
low_bg_color: "#353535"
charging_fg_color: "#6080A0"
charging_bg_color: "#353535"
# sample
# - type: ExecLabel
# rect: [50, 20, 200, 50]
# font_size: 14
# fg_color: "#FFFFFF"
# exec: ["echo", "customize me! see watch.yaml"]
# interval: 0 # seconds
### MirrorButton
# Bring an additional PipeWire screen, window, region or virtual screen share into VR.
# These are view-only, and will not respond to pointers by moving your mouse.
# You may have as many as you like, but the `name` must be unique for each.
# Controls:
# - Blue Click: Show/hide. Shows pipewire prompt on first show.
# - Orange Click: Toggle lock in place
# - Purple Click: Stop capture. After doing this, you may Blue-click again to select a different source.
# - Scroll: Adjust opacity
# Warning:
# - Window shares may stop updating if the window goes off-screen or is on an inactive workspace
# - Resizing, minimizing, maximizing windows may break stuff. Complain to your xdg-desktop-portal implementation.
# - Selections are not saved across sessions
#- type: MirrorButton
# rect: [354, 0, 46, 32]
# font_size: 14
# fg_color: "#FFFFFF"
# bg_color: "#B05050"
# name: "M1"
# text: "M1"
# show_hide: false # should it respond to show/hide binding?
low_threshold: 20
# volume buttons
- type: ExecButton
- type: Button
rect: [327, 52, 46, 32]
font_size: 14
fg_color: "#FFFFFF"
bg_color: "#505050"
text: "+"
exec: [ "pactl", "set-sink-volume", "@DEFAULT_SINK@", "+5%" ]
- type: ExecButton
click_down:
- type: Exec
command: [ "pactl", "set-sink-volume", "@DEFAULT_SINK@", "+5%" ]
- type: Button
rect: [327, 116, 46, 32]
font_size: 14
fg_color: "#FFFFFF"
bg_color: "#505050"
text: "-"
exec: [ "pactl", "set-sink-volume", "@DEFAULT_SINK@", "-5%" ]
click_down:
- type: Exec
command: [ "pactl", "set-sink-volume", "@DEFAULT_SINK@", "-5%" ]