fix visibility toggle on input request

This commit is contained in:
yggverse 2024-10-16 08:35:20 +03:00
parent 55afe17271
commit 179cad9a57
2 changed files with 7 additions and 1 deletions

View File

@ -28,6 +28,7 @@ impl Input {
// Actions // Actions
pub fn show(&self, placeholder: &str, sensitive: bool) { pub fn show(&self, placeholder: &str, sensitive: bool) {
self.content.set(placeholder, sensitive); self.content.set(placeholder, sensitive);
self.widget.show(true);
} }
// Getters // Getters

View File

@ -1,5 +1,5 @@
use adw::ToolbarView; use adw::ToolbarView;
use gtk::Box; use gtk::{prelude::WidgetExt, Box};
use std::sync::Arc; use std::sync::Arc;
pub struct Widget { pub struct Widget {
@ -17,6 +17,11 @@ impl Widget {
Arc::new(Self { gobject }) Arc::new(Self { gobject })
} }
// Actions
pub fn show(&self, visible: bool) {
self.gobject.set_visible(visible);
}
// Getters // Getters
pub fn gobject(&self) -> &ToolbarView { pub fn gobject(&self) -> &ToolbarView {
&self.gobject &self.gobject