mirror of
https://github.com/emilk/egui.git
synced 2026-08-31 22:00:03 -04:00
Add note on frame conflict
This commit is contained in:
@@ -162,6 +162,9 @@ impl<'a> Button<'a> {
|
|||||||
/// If `false`, the button will not have a frame when inactive.
|
/// If `false`, the button will not have a frame when inactive.
|
||||||
///
|
///
|
||||||
/// Default: `true`.
|
/// Default: `true`.
|
||||||
|
///
|
||||||
|
/// Note: When [`Self::frame`] (or `ui.visuals().button_frame`) is `false`, this setting
|
||||||
|
/// has no effect.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn frame_when_inactive(mut self, frame_when_inactive: bool) -> Self {
|
pub fn frame_when_inactive(mut self, frame_when_inactive: bool) -> Self {
|
||||||
self.frame_when_inactive = frame_when_inactive;
|
self.frame_when_inactive = frame_when_inactive;
|
||||||
@@ -276,7 +279,7 @@ impl<'a> Button<'a> {
|
|||||||
|
|
||||||
let mut has_frame = frame.unwrap_or_else(|| ui.visuals().button_frame);
|
let mut has_frame = frame.unwrap_or_else(|| ui.visuals().button_frame);
|
||||||
|
|
||||||
let mut button_padding = if has_frame || !frame_when_inactive {
|
let mut button_padding = if has_frame {
|
||||||
ui.spacing().button_padding
|
ui.spacing().button_padding
|
||||||
} else {
|
} else {
|
||||||
Vec2::ZERO
|
Vec2::ZERO
|
||||||
|
|||||||
Reference in New Issue
Block a user