remove unnecessary layer of tab divs from edit.xml

This commit is contained in:
galister
2025-11-24 19:32:48 +09:00
parent 8485639e00
commit 8bd1097886
2 changed files with 37 additions and 44 deletions

View File

@@ -1,11 +1,8 @@
use std::{collections::HashMap, rc::Rc};
use wgui::{
components::button::ComponentButton,
event::CallbackDataCommon,
layout::WidgetID,
parser::Fetchable,
taffy::{Display, Style},
components::button::ComponentButton, event::CallbackDataCommon, layout::WidgetID,
parser::Fetchable, taffy,
};
use crate::overlays::edit::EditModeWrapPanel;
@@ -80,14 +77,18 @@ impl ButtonPaneTabSwitcher {
}
fn set_tab_active(common: &mut CallbackDataCommon, data: &TabData, active: bool) {
let style = Style {
display: if active {
Display::Block
} else {
Display::None
},
..Default::default()
let mut style = common
.state
.get_widget_style(data.pane)
.unwrap_or(&taffy::Style::DEFAULT)
.clone();
style.display = if active {
taffy::Display::Block
} else {
taffy::Display::None
};
common.alterables.set_style(data.pane, style);
if let Some(button) = data.button.as_ref() {
button.set_sticky_state(common, active);