remove unnecessary layer of tab divs from edit.xml
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user