Allow to hide upper notebook (#491)
This commit is contained in:
parent
a8aa8a2a23
commit
457b55ada5
|
@ -2,7 +2,7 @@ use gtk::prelude::*;
|
|||
|
||||
use crate::gui_data::GuiData;
|
||||
|
||||
pub fn connect_hide_text_view_errors(gui_data: &GuiData) {
|
||||
pub fn connect_show_hide_ui(gui_data: &GuiData) {
|
||||
let check_button_settings_show_text_view = gui_data.settings.check_button_settings_show_text_view.clone();
|
||||
let buttons_show_errors = gui_data.bottom_buttons.buttons_show_errors.clone();
|
||||
let scrolled_window_errors = gui_data.scrolled_window_errors.clone();
|
||||
|
@ -16,4 +16,15 @@ pub fn connect_hide_text_view_errors(gui_data: &GuiData) {
|
|||
check_button_settings_show_text_view.set_active(true);
|
||||
}
|
||||
});
|
||||
|
||||
let buttons_show_upper_notebook = gui_data.bottom_buttons.buttons_show_upper_notebook.clone();
|
||||
let notebook_upper = gui_data.upper_notebook.notebook_upper.clone();
|
||||
|
||||
buttons_show_upper_notebook.connect_clicked(move |_| {
|
||||
if notebook_upper.is_visible() {
|
||||
notebook_upper.hide();
|
||||
} else {
|
||||
notebook_upper.show();
|
||||
}
|
||||
});
|
||||
}
|
|
@ -11,6 +11,7 @@ pub struct GuiBottomButtons {
|
|||
pub buttons_hardlink: gtk::Button,
|
||||
pub buttons_move: gtk::Button,
|
||||
pub buttons_show_errors: gtk::Button,
|
||||
pub buttons_show_upper_notebook: gtk::Button,
|
||||
pub buttons_names: [String; 7],
|
||||
pub buttons_array: [Widget; 7],
|
||||
}
|
||||
|
@ -38,7 +39,9 @@ impl GuiBottomButtons {
|
|||
));
|
||||
|
||||
let buttons_show_errors: gtk::Button = builder.object("buttons_show_errors").unwrap();
|
||||
buttons_show_errors.set_tooltip_text(Some("Show/Hide bottom error panel"));
|
||||
buttons_show_errors.set_tooltip_text(Some("Show/Hide bottom error panel."));
|
||||
let buttons_show_upper_notebook: gtk::Button = builder.object("buttons_show_upper_notebook").unwrap();
|
||||
buttons_show_upper_notebook.set_tooltip_text(Some("Show/Hide upper notebook panel."));
|
||||
|
||||
let buttons_names = [
|
||||
"search".to_string(),
|
||||
|
@ -70,6 +73,7 @@ impl GuiBottomButtons {
|
|||
buttons_hardlink,
|
||||
buttons_move,
|
||||
buttons_show_errors,
|
||||
buttons_show_upper_notebook,
|
||||
buttons_names,
|
||||
buttons_array,
|
||||
}
|
||||
|
|
|
@ -18,12 +18,12 @@ use crate::connect_button_select::*;
|
|||
use crate::connect_button_stop::*;
|
||||
use crate::connect_duplicate_buttons::*;
|
||||
use crate::connect_header_buttons::*;
|
||||
use crate::connect_hide_text_view_errors::*;
|
||||
use crate::connect_notebook_tabs::*;
|
||||
use crate::connect_popovers::*;
|
||||
use crate::connect_progress_window::*;
|
||||
use crate::connect_selection_of_directories::*;
|
||||
use crate::connect_settings::*;
|
||||
use crate::connect_show_hide_ui::*;
|
||||
use crate::connect_similar_image_size_change::*;
|
||||
use crate::gui_data::*;
|
||||
use crate::initialize_gui::*;
|
||||
|
@ -41,12 +41,12 @@ mod connect_button_select;
|
|||
mod connect_button_stop;
|
||||
mod connect_duplicate_buttons;
|
||||
mod connect_header_buttons;
|
||||
mod connect_hide_text_view_errors;
|
||||
mod connect_notebook_tabs;
|
||||
mod connect_popovers;
|
||||
mod connect_progress_window;
|
||||
mod connect_selection_of_directories;
|
||||
mod connect_settings;
|
||||
mod connect_show_hide_ui;
|
||||
mod connect_similar_image_size_change;
|
||||
mod create_tree_view;
|
||||
mod gui_about;
|
||||
|
@ -139,7 +139,7 @@ fn main() {
|
|||
futures_receiver_invalid_symlinks,
|
||||
futures_receiver_broken_files,
|
||||
);
|
||||
connect_hide_text_view_errors(&gui_data);
|
||||
connect_show_hide_ui(&gui_data);
|
||||
connect_settings(&gui_data);
|
||||
connect_button_about(&gui_data);
|
||||
connect_about_buttons(&gui_data);
|
||||
|
|
|
@ -2141,6 +2141,27 @@ Author: Rafał Mikrut
|
|||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="buttons_show_upper_notebook">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="icon-name">text-x-script</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="pack-type">end</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="action_buttons">
|
||||
<property name="visible">True</property>
|
||||
|
@ -2416,7 +2437,7 @@ Author: Rafał Mikrut
|
|||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="pack-type">end</property>
|
||||
<property name="position">2</property>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
|
|
Loading…
Reference in New Issue