parent
8a6e4ebb88
commit
c9e7f052e1
3 changed files with 17 additions and 6 deletions
|
|
@ -891,6 +891,10 @@ impl LpImageView {
|
||||||
self.imp().zoom_menu_button.clone()
|
self.imp().zoom_menu_button.clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn zoom_toggle(&self) -> gtk::ToggleButton {
|
||||||
|
self.imp().zoom_toggle.clone()
|
||||||
|
}
|
||||||
|
|
||||||
pub fn zoom_value_f64(&self) -> Option<f64> {
|
pub fn zoom_value_f64(&self) -> Option<f64> {
|
||||||
let mut value = self.imp().zoom_value.text().to_string();
|
let mut value = self.imp().zoom_value.text().to_string();
|
||||||
let locale_settings = util::locale_settings();
|
let locale_settings = util::locale_settings();
|
||||||
|
|
|
||||||
|
|
@ -757,6 +757,12 @@ impl LpImageWindow {
|
||||||
.is_some_and(|image| !image.is_best_fit()),
|
.is_some_and(|image| !image.is_best_fit()),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
self.image_view().zoom_toggle().set_sensitive(enabled_shown);
|
||||||
|
|
||||||
|
self.image_view()
|
||||||
|
.zoom_menu_button()
|
||||||
|
.set_sensitive(enabled_shown);
|
||||||
|
|
||||||
// Actions that are available if there is an current image, even if it's not
|
// Actions that are available if there is an current image, even if it's not
|
||||||
// shown
|
// shown
|
||||||
const ACTIONS_CURRENT: &[Action] = &[
|
const ACTIONS_CURRENT: &[Action] = &[
|
||||||
|
|
@ -774,11 +780,12 @@ impl LpImageWindow {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Editing related actions
|
// Editing related actions
|
||||||
let enable_editing = self
|
let enable_editing = enabled_shown
|
||||||
.imp()
|
&& self
|
||||||
.image_view
|
.imp()
|
||||||
.current_image()
|
.image_view
|
||||||
.is_some_and(|x| x.editable());
|
.current_image()
|
||||||
|
.is_some_and(|x| x.editable());
|
||||||
self.action_set_enabled(&Action::Edit, enable_editing);
|
self.action_set_enabled(&Action::Edit, enable_editing);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -126,7 +126,7 @@
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child type="end">
|
<child type="end">
|
||||||
<object class="GtkButton" id="edit_button">
|
<object class="GtkButton">
|
||||||
<property name="action-name">win.edit</property>
|
<property name="action-name">win.edit</property>
|
||||||
<property name="icon-name">crop-symbolic</property>
|
<property name="icon-name">crop-symbolic</property>
|
||||||
<property name="tooltip-text" translatable="yes">Edit Image</property>
|
<property name="tooltip-text" translatable="yes">Edit Image</property>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue