Skip to content

Commit fdccab3

Browse files
committed
allow inversion of scale direction
1 parent ba95792 commit fdccab3

File tree

5 files changed

+16
-3
lines changed

5 files changed

+16
-3
lines changed

CONFIGURATION.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,15 @@ Window settings.
3030
- **`window_bar_height`** (integer): Height of the window title bars in pixels (default: `20`).
3131
- **`text_color`** (string): Text color of the window title bars in hex format (e.g., `"#ffffff"`).
3232
- **`background_color`** (string): Background color of the window title bars in hex format (e.g., `"#272727"`).
33+
- **`reverse_resize`** (boolean): Reverse the direction of window resizing (default: `false`).
3334
```toml
3435
[window]
3536
scale_steps = 20
3637
window_bars = false
3738
window_bar_height = 20
3839
text_color = "#ffffff"
3940
background_color = "#272727"
41+
reverse_resize = false
4042
```
4143

4244
### `[keyboard]`

bugs.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Window title changes do not trigger a bar refresh, leaving them unupdated until the next general bar update.

gridwm.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ update_ms = "auto"
88
scale_steps = 20
99
window_bars = true
1010
window_bar_height = 20
11+
reverse_resize = true
1112

1213
[keyboard]
1314
layout = "de"

src/gridwm/config.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ pub struct Window {
2626
pub window_bar_height: u32,
2727
pub text_color: String,
2828
pub background_color: String,
29+
pub reverse_resize: bool,
2930
}
3031

3132
impl Default for Window {
@@ -36,6 +37,7 @@ impl Default for Window {
3637
window_bar_height: 20,
3738
text_color: "#ffffff".into(),
3839
background_color: "#272727".into(),
40+
reverse_resize: false,
3941
}
4042
}
4143
}

src/gridwm/mod.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -500,13 +500,20 @@ impl GridWM {
500500
false
501501
};
502502

503-
// TODO: make resize direction configurable
504503
if is_drag_bind {
505504
self.handle_drag_start(btn_event);
506505
} else if is_scroll_up {
507-
self.scale_up(btn_event);
506+
if !self.config.window.reverse_resize {
507+
self.scale_up(btn_event);
508+
} else {
509+
self.scale_down(btn_event);
510+
}
508511
} else if is_scroll_down {
509-
self.scale_down(btn_event);
512+
if !self.config.window.reverse_resize {
513+
self.scale_down(btn_event);
514+
} else {
515+
self.scale_up(btn_event);
516+
}
510517
} else {
511518
self.handle_button(event);
512519
}

0 commit comments

Comments
 (0)