update decor.xml, fix max_size
This commit is contained in:
@@ -1,23 +1,31 @@
|
||||
<layout>
|
||||
<macro name="window_button" padding="4" align_items="center" />
|
||||
|
||||
<elements>
|
||||
<div flex_grow="1" height="48">
|
||||
<rectangle
|
||||
width="100%" height="100%"
|
||||
margin="4" box_sizing="border_box"
|
||||
border_color="~color_faded" border="2"
|
||||
round="50%" color="~color_faded"
|
||||
justify_content="space_between">
|
||||
|
||||
<label id="label_title" color="~color_text" size="18" text="Test" weight="bold" />
|
||||
|
||||
|
||||
<Button macro="button_style" tooltip="WATCH.EDIT_MODE" _press="" border_color="~color_faded_translucent" color="~color_faded_50" color2="~color_faded_10">
|
||||
<sprite width="24" height="24" src="watch/edit.svg" />
|
||||
flex_grow="1" height="48"
|
||||
padding="8" border="2"
|
||||
round="8"
|
||||
align_items="center"
|
||||
justify_content="space_between"
|
||||
color="~color_background"
|
||||
border_color="~color_accent"
|
||||
>
|
||||
<label id="label_title" margin_left="8" color="~color_text" size="22" weight="bold" />
|
||||
<div gap="4">
|
||||
<Button macro="window_button" tooltip="WATCH.EDIT_MODE" _press=""
|
||||
border_color="~color_faded_translucent" color="~color_faded_50" color2="~color_faded_10">
|
||||
<sprite width="28" height="28" src="watch/edit.svg" />
|
||||
</Button>
|
||||
|
||||
<Button macro="button_style" tooltip="DECOR.CLOSE_WINDOW" _long_release="" border_color="~color_danger_translucent" color="~color_danger_50" color2="~color_danger_10">
|
||||
<sprite width="24" height="24" src="edit/close.svg" />
|
||||
<Button macro="window_button" tooltip="DECOR.CLOSE_WINDOW" _long_release=""
|
||||
border_color="~color_danger_translucent" color="~color_danger_50" color2="~color_danger_10">
|
||||
<sprite width="28" height="28" src="edit/close.svg" />
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
</rectangle>
|
||||
</div>
|
||||
</elements>
|
||||
</layout>
|
||||
@@ -43,7 +43,7 @@ use crate::{
|
||||
};
|
||||
|
||||
const BORDER_SIZE: u32 = 5;
|
||||
const BAR_SIZE: u32 = 40;
|
||||
const BAR_SIZE: u32 = 48;
|
||||
|
||||
pub fn create_wl_window_overlay(
|
||||
name: Arc<str>,
|
||||
@@ -117,7 +117,7 @@ impl WvrWindowBackend {
|
||||
.fetch_widget_as::<WidgetLabel>(&panel.layout.state, "label_title")?;
|
||||
title.set_text_simple(
|
||||
&mut app.wgui_globals.get(),
|
||||
Translation::from_raw_text(&*name),
|
||||
Translation::from_raw_text(&name),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -162,7 +162,10 @@ impl WvrWindowBackend {
|
||||
self.mouse_transform = Affine2::from_scale_angle_translation(scale, 0.0, translation);
|
||||
self.uv_range = translation[0]..=(1.0 - translation[0]);
|
||||
|
||||
self.panel.max_size = vec2((meta.extent[0] + BORDER_SIZE * 2) as _, BAR_SIZE as _);
|
||||
self.panel.max_size = vec2(
|
||||
(meta.extent[0]/* + BORDER_SIZE * 2 (disabled for now) */) as _,
|
||||
BAR_SIZE as _,
|
||||
);
|
||||
self.panel.update_layout(app)?;
|
||||
|
||||
Ok(())
|
||||
@@ -183,6 +186,7 @@ impl OverlayBackend for WvrWindowBackend {
|
||||
self.panel.resume(app)
|
||||
}
|
||||
|
||||
#[allow(clippy::too_many_lines)]
|
||||
fn should_render(&mut self, app: &mut AppState) -> anyhow::Result<ShouldRender> {
|
||||
let should_render_panel = self.panel.should_render(app)?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user