mirror of
https://github.com/pinnacle-comp/pinnacle.git
synced 2025-01-30 20:34:49 +01:00
Fix RefCell errors
I hate refcells, why am I putting everything in them
This commit is contained in:
parent
dbde8545c3
commit
eb85c92164
1 changed files with 18 additions and 10 deletions
|
@ -141,9 +141,11 @@ impl WindowElement {
|
||||||
|
|
||||||
/// This method uses a [`RefCell`].
|
/// This method uses a [`RefCell`].
|
||||||
pub fn toggle_fullscreen(&self) {
|
pub fn toggle_fullscreen(&self) {
|
||||||
self.with_state(|state| match state.fullscreen_or_maximized {
|
match self.with_state(|state| state.fullscreen_or_maximized) {
|
||||||
FullscreenOrMaximized::Neither | FullscreenOrMaximized::Maximized => {
|
FullscreenOrMaximized::Neither | FullscreenOrMaximized::Maximized => {
|
||||||
state.fullscreen_or_maximized = FullscreenOrMaximized::Fullscreen;
|
self.with_state(|state| {
|
||||||
|
state.fullscreen_or_maximized = FullscreenOrMaximized::Fullscreen;
|
||||||
|
});
|
||||||
|
|
||||||
match self {
|
match self {
|
||||||
WindowElement::Wayland(window) => {
|
WindowElement::Wayland(window) => {
|
||||||
|
@ -167,9 +169,11 @@ impl WindowElement {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FullscreenOrMaximized::Fullscreen => {
|
FullscreenOrMaximized::Fullscreen => {
|
||||||
state.fullscreen_or_maximized = FullscreenOrMaximized::Neither;
|
self.with_state(|state| {
|
||||||
|
state.fullscreen_or_maximized = FullscreenOrMaximized::Neither;
|
||||||
|
});
|
||||||
|
|
||||||
match state.floating_or_tiled {
|
match self.with_state(|state| state.floating_or_tiled) {
|
||||||
FloatingOrTiled::Floating(current_rect) => {
|
FloatingOrTiled::Floating(current_rect) => {
|
||||||
self.change_geometry(current_rect);
|
self.change_geometry(current_rect);
|
||||||
self.set_floating_states();
|
self.set_floating_states();
|
||||||
|
@ -177,14 +181,16 @@ impl WindowElement {
|
||||||
FloatingOrTiled::Tiled(_) => self.set_tiled_states(),
|
FloatingOrTiled::Tiled(_) => self.set_tiled_states(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// This method uses a [`RefCell`].
|
/// This method uses a [`RefCell`].
|
||||||
pub fn toggle_maximized(&self) {
|
pub fn toggle_maximized(&self) {
|
||||||
self.with_state(|state| match state.fullscreen_or_maximized {
|
match self.with_state(|state| state.fullscreen_or_maximized) {
|
||||||
FullscreenOrMaximized::Neither | FullscreenOrMaximized::Fullscreen => {
|
FullscreenOrMaximized::Neither | FullscreenOrMaximized::Fullscreen => {
|
||||||
state.fullscreen_or_maximized = FullscreenOrMaximized::Maximized;
|
self.with_state(|state| {
|
||||||
|
state.fullscreen_or_maximized = FullscreenOrMaximized::Maximized;
|
||||||
|
});
|
||||||
|
|
||||||
match self {
|
match self {
|
||||||
WindowElement::Wayland(window) => {
|
WindowElement::Wayland(window) => {
|
||||||
|
@ -208,9 +214,11 @@ impl WindowElement {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FullscreenOrMaximized::Maximized => {
|
FullscreenOrMaximized::Maximized => {
|
||||||
state.fullscreen_or_maximized = FullscreenOrMaximized::Neither;
|
self.with_state(|state| {
|
||||||
|
state.fullscreen_or_maximized = FullscreenOrMaximized::Neither;
|
||||||
|
});
|
||||||
|
|
||||||
match state.floating_or_tiled {
|
match self.with_state(|state| state.floating_or_tiled) {
|
||||||
FloatingOrTiled::Floating(current_rect) => {
|
FloatingOrTiled::Floating(current_rect) => {
|
||||||
self.change_geometry(current_rect);
|
self.change_geometry(current_rect);
|
||||||
self.set_floating_states();
|
self.set_floating_states();
|
||||||
|
@ -218,7 +226,7 @@ impl WindowElement {
|
||||||
FloatingOrTiled::Tiled(_) => self.set_tiled_states(),
|
FloatingOrTiled::Tiled(_) => self.set_tiled_states(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_floating_states(&self) {
|
fn set_floating_states(&self) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue