mirror of
https://github.com/emilk/egui.git
synced 2026-08-29 04:40:03 -04:00
Panels: Take separator line width into account (#8367)
This fixes a small styling bug: the width of the panel's resize-handle-line was not included in the outer width of the panel. Now it is.
This commit is contained in:
@@ -859,8 +859,27 @@ impl Panel {
|
||||
|
||||
/// The configured [`Frame`], or the default side/top panel frame for this [`Ui`].
|
||||
fn resolve_frame(&self, ui: &Ui) -> Frame {
|
||||
self.frame
|
||||
.unwrap_or_else(|| Frame::side_top_panel(ui.style()))
|
||||
let mut frame = self
|
||||
.frame
|
||||
.unwrap_or_else(|| Frame::side_top_panel(ui.style()));
|
||||
|
||||
let has_separator_line = self.show_separator_line || self.resizable;
|
||||
|
||||
if has_separator_line {
|
||||
// The separator line has a thickness that we need to account for.
|
||||
let widgets = &ui.style().visuals.widgets;
|
||||
let stroke_width = widgets.noninteractive.bg_stroke.width.round() as i8;
|
||||
|
||||
let margin_side = match self.side {
|
||||
PanelSide::Left => &mut frame.inner_margin.right,
|
||||
PanelSide::Right => &mut frame.inner_margin.left,
|
||||
PanelSide::Top => &mut frame.inner_margin.bottom,
|
||||
PanelSide::Bottom => &mut frame.inner_margin.top,
|
||||
};
|
||||
*margin_side = (*margin_side).saturating_add(stroke_width);
|
||||
}
|
||||
|
||||
frame
|
||||
}
|
||||
|
||||
/// Panel is fully closed. If the user is still dragging the resize handle
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:288e11a1fa684575155826a760d5aecc5855e1f4b68bc8954441bf3ac015ee84
|
||||
size 335175
|
||||
oid sha256:dda3ad81551d0001bb9d3614a266010e44c8c18700964d8734c3e825672d9383
|
||||
size 334759
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d674918c635bfc865043f2123c0f5d4a671dd21ba7b878c056e817b19f2e8f00
|
||||
size 92770
|
||||
oid sha256:9035687ecd3aae0d8639000f091592d69acec0e73e7ba17e04c9794c5321cb1e
|
||||
size 92771
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:1f066e712888a57b5c5ca6ccd6e138c933ab04acc44a3fce5912cfe47852c672
|
||||
size 168875
|
||||
oid sha256:418f9bc7eb13dd32ce2bba8e4b8003b095dd00aa8c30f1640ea0f94f87a085eb
|
||||
size 168430
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:1cf4c34af7b69cd8220b11ff7e355ddf8d7b52a43a60a1748abf9cc1d5c7da9b
|
||||
size 98869
|
||||
oid sha256:8d278d0d879e8cb44c4c2e65bdee4441616abcf3507adc37959ccf042991b31c
|
||||
size 98780
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:8d48079f85e9529f4b463bbaf2c948a64126388ef32df0584b586dc0ae48a35b
|
||||
size 344919
|
||||
oid sha256:d20f4bf882ee16abde6268fe766ceb67dccdfc5d2a509a952cef1d7af72dc3c6
|
||||
size 344141
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:3e44cef45d27ddd64b0d2f6de0b7005846147bce54a9b8b1223ba9a0a02c2416
|
||||
oid sha256:125d6fe0cdc81a0c7973317e62c528c1beff7ceaedb9cb1fb91bc8d6674c8dc6
|
||||
size 62830
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:eba6e690937fbbd22c8edfce14078f50998e968324d8073d5db5829493d957e0
|
||||
oid sha256:9a21708315ae4514c1ff2c71075ccce2bef4627720808e4eebc9d7922388a17f
|
||||
size 5292
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:84e6030760561e308a190d2eb9781f53b896fbea5d11a3548b73d68c49f4d525
|
||||
oid sha256:a0c8d12d6f3741d33b993b5390fba5b845778a1f4dcf6d661513e65243978e18
|
||||
size 65797
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:84e6030760561e308a190d2eb9781f53b896fbea5d11a3548b73d68c49f4d525
|
||||
oid sha256:a0c8d12d6f3741d33b993b5390fba5b845778a1f4dcf6d661513e65243978e18
|
||||
size 65797
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:cf09470a6628e62421bfa754ce238dd13820ba0bf8146ae835e539874d39a150
|
||||
size 4882
|
||||
oid sha256:054c9005865ff2d6c1ee6c76539453fbad6005d1c62693de5653c4bb00164322
|
||||
size 4881
|
||||
|
||||
Reference in New Issue
Block a user