mirror of
https://github.com/emilk/egui.git
synced 2026-09-01 14:20:04 -04:00
Use ClassName for DragValue::CLASS
`has_class` now takes `&str`, so class definitions stay `ClassName` for consistency with the built-in `Button` and `TextEdit` classes. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -147,12 +147,11 @@ impl StyleProvider<TextEditStyle> for DefaultStyle {
|
||||
atom_layout: AtomLayoutStyle {
|
||||
frame: Frame {
|
||||
fill,
|
||||
stroke,
|
||||
corner_radius: widget_visuals.corner_radius,
|
||||
inner_margin: Margin::symmetric(4, 2),
|
||||
..Default::default()
|
||||
}
|
||||
.expand_in_place(widget_visuals.expansion),
|
||||
.apply_stroke_and_expansion_without_layout_shift(stroke, widget_visuals.expansion),
|
||||
gap: style.spacing.icon_spacing,
|
||||
text_style: text,
|
||||
..Default::default()
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
use crate::{
|
||||
Atom, AtomExt as _, AtomKind, Atoms, Button, CursorIcon, Id, IntoAtoms, Key, MINUS_CHAR_STR,
|
||||
Modifiers, NumExt as _, Response, RichText, Sense, TextEdit, TextWrapMode, Ui, Widget,
|
||||
WidgetInfo, emath, text,
|
||||
widget_style::{Classes, HasClasses},
|
||||
WidgetInfo,
|
||||
class::{ClassName, Classes, HasClasses},
|
||||
emath, text,
|
||||
};
|
||||
use core::{cmp::Ordering, ops::RangeInclusive};
|
||||
use emath::Vec2;
|
||||
@@ -72,7 +73,7 @@ impl<'a> DragValue<'a> {
|
||||
const ATOM_ID: &'static str = "drag_item";
|
||||
|
||||
/// Present on the [`Button`] and the [`TextEdit`] a drag value is built from.
|
||||
pub const CLASS: &'static str = "egui::drag_value";
|
||||
pub const CLASS: ClassName = ClassName::from_static("egui::drag_value");
|
||||
|
||||
pub fn new<Num: emath::Numeric>(value: &'a mut Num) -> Self {
|
||||
let slf = Self::from_get_set(move |v: Option<f64>| {
|
||||
|
||||
@@ -8,6 +8,7 @@ use crate::{
|
||||
CursorIcon, Event, EventFilter, FontSelection, Frame, IMEPurpose, Id, IdSalt, ImeEvent,
|
||||
IntoAtoms, IntoSizedResult, Key, KeyboardShortcut, Margin, Modifiers, NumExt as _, Response,
|
||||
Sense, SizedAtomKind, TextBuffer, TextStyle, Ui, Vec2, Widget, WidgetInfo, WidgetWithState,
|
||||
class::{ClassName, Classes, HasClasses},
|
||||
epaint,
|
||||
os::OperatingSystem,
|
||||
output::OutputEvent,
|
||||
@@ -17,7 +18,7 @@ use crate::{
|
||||
self, CCursorRange, text_cursor_state::cursor_rect, visuals::paint_text_selection,
|
||||
},
|
||||
vec2,
|
||||
widget_style::{ClassName, Classes, HasClasses, TextEditStyle},
|
||||
widget_style::TextEditStyle,
|
||||
};
|
||||
|
||||
use super::{TextEditOutput, TextEditState};
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f916e217bd4beb3637acb5394a7da876f9ec684860c9ca922f8bfa3ded6a2684
|
||||
size 9462
|
||||
oid sha256:73c293f63b9b7f02fd0f3a506dd076eb1e653b7fbb7554603e457b9ad2552f48
|
||||
size 9276
|
||||
|
||||
Reference in New Issue
Block a user