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| {
|
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
|
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()
|
.clicked()
|
||||||
{
|
{
|
||||||
let new_post = NewPost::new(
|
let new_post = NewPost::new(
|
||||||
|
|||||||
Reference in New Issue
Block a user