mirror of
https://github.com/aljazceru/notedeck.git
synced 2026-01-24 10:44:19 +01:00
Merge disable post button if draft buffer empty #469
William Casarin (2):
ui: simply hide post button if buffer is empty
kernelkind (1):
disable post button if draft buffer empty
This commit is contained in:
@@ -208,8 +208,16 @@ impl<'a> PostView<'a> {
|
||||
}
|
||||
|
||||
ui.with_layout(egui::Layout::right_to_left(egui::Align::BOTTOM), |ui| {
|
||||
if self.draft.buffer.is_empty() {
|
||||
// Don't render button if our buffer is empty
|
||||
return None;
|
||||
}
|
||||
|
||||
if ui
|
||||
.add_sized([91.0, 32.0], egui::Button::new("Post now"))
|
||||
.add_sized(
|
||||
[91.0, 32.0],
|
||||
egui::Button::new("Post now")
|
||||
)
|
||||
.clicked()
|
||||
{
|
||||
let new_post = NewPost::new(
|
||||
|
||||
Reference in New Issue
Block a user