Skip to content

Commit 4cede42

Browse files
committed
Add ui.weak(text)
1 parent defc400 commit 4cede42

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

CHANGELOG.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ NOTE: [`epaint`](epaint/CHANGELOG.md), [`eframe`](eframe/CHANGELOG.md), [`egui_w
2121
* Added `ui.data()`, `ctx.data()`, `ctx.options()` and `ctx.tessellation_options()` ([#1175](https://github.com/emilk/egui/pull/1175)).
2222
* Added `Plot::allow_boxed_zoom()`, `Plot::boxed_zoom_pointer()` for boxed zooming on plots ([#1188](https://github.com/emilk/egui/pull/1188)).
2323
* Added linked axis support for plots via `plot::LinkedAxisGroup` ([#1184](https://github.com/emilk/egui/pull/1184)).
24-
* Added `Response::on_hover_text_at_pointer` as a convenience akin to `Response::on_hover_text`. ([1179](https://github.com/emilk/egui/pull/1179))
24+
* Added `Response::on_hover_text_at_pointer` as a convenience akin to `Response::on_hover_text` ([1179](https://github.com/emilk/egui/pull/1179)).
25+
* Added `ui.weak(text)`.
2526

2627
### Changed 🔧
2728
* ⚠️ `Context::input` and `Ui::input` now locks a mutex. This can lead to a dead-lock is used in an `if let` binding!
@@ -44,8 +45,8 @@ NOTE: [`epaint`](epaint/CHANGELOG.md), [`eframe`](eframe/CHANGELOG.md), [`egui_w
4445
* `ScrollArea::show` now returns a `ScrollAreaOutput`, so you might need to add `.inner` after the call to it ([#1166](https://github.com/emilk/egui/pull/1166)).
4546

4647
### Fixed 🐛
47-
* Context menus now respects the theme ([#1043](https://github.com/emilk/egui/pull/1043))
48-
* Plot `Orientation` was not public, although fields using this type were ([#1130](https://github.com/emilk/egui/pull/1130))
48+
* Context menus now respects the theme ([#1043](https://github.com/emilk/egui/pull/1043)).
49+
* Plot `Orientation` was not public, although fields using this type were ([#1130](https://github.com/emilk/egui/pull/1130)).
4950
* Fixed `enable_drag` for Windows ([#1108](https://github.com/emilk/egui/pull/1108)).
5051
* Calling `Context::set_pixels_per_point` before the first frame will now work.
5152

egui/src/ui.rs

+7
Original file line numberDiff line numberDiff line change
@@ -1158,6 +1158,13 @@ impl Ui {
11581158
Label::new(text.into().strong()).ui(self)
11591159
}
11601160

1161+
/// Show text that is waker (fainter color).
1162+
///
1163+
/// Shortcut for `ui.label(RichText::new(text).weak())`
1164+
pub fn weak(&mut self, text: impl Into<RichText>) -> Response {
1165+
Label::new(text.into().weak()).ui(self)
1166+
}
1167+
11611168
/// Shortcut for `add(Hyperlink::new(url))`
11621169
///
11631170
/// See also [`Hyperlink`].

0 commit comments

Comments
 (0)