window: Use shortcuts instead of accels
Application level accels will also work if AdwDialogs are open. Therefore, use shortcuts wherever possible.
This commit is contained in:
parent
e129e842a6
commit
57d8bba071
12 changed files with 562 additions and 223 deletions
|
|
@ -1,12 +1,8 @@
|
|||
use adw::prelude::*;
|
||||
use adw::subclass::prelude::*;
|
||||
use glib::{clone, Properties};
|
||||
use gtk::prelude::*;
|
||||
use gtk::CompositeTemplate;
|
||||
|
||||
use crate::deps::*;
|
||||
use crate::util::gettext::*;
|
||||
use crate::widgets::LpImage;
|
||||
|
||||
mod imp {
|
||||
use super::*;
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@
|
|||
<property name="vexpand">true</property>
|
||||
<child>
|
||||
<object class="GtkTextView" id="message">
|
||||
<property name="editable">false</property>
|
||||
<property name="wrap-mode">word-char</property>
|
||||
</object>
|
||||
</child>
|
||||
|
|
|
|||
|
|
@ -193,11 +193,11 @@ impl LpImagePage {
|
|||
let image = self.image();
|
||||
|
||||
if image.is_unsupported() {
|
||||
let message = if glycin::supported_mime_types().await.len() == 0 {
|
||||
let message = if glycin::supported_mime_types().await.is_empty() {
|
||||
// Translators: {} is replace with a version number
|
||||
gettext_f(
|
||||
"No image loaders available. Mabye the “glycin-loaders” package with compatibility version “{}+” is not installed.",
|
||||
[ format!("{}+", glycin::COMPAT_VERSION.to_string())])
|
||||
[ format!("{}+", glycin::COMPAT_VERSION)])
|
||||
} else {
|
||||
let mime_type = image.metadata().mime_type().unwrap_or_default();
|
||||
let content_type = gio::content_type_from_mime_type(&mime_type).unwrap_or_default();
|
||||
|
|
@ -221,6 +221,9 @@ impl LpImagePage {
|
|||
};
|
||||
|
||||
imp.error_page.set_description(Some(&message));
|
||||
imp.error_more_info.set_visible(false);
|
||||
|
||||
imp.stack.set_visible_child(&*imp.error_page);
|
||||
} else if let Some(err) = image.error() {
|
||||
imp.error_more_info
|
||||
.connect_clicked(glib::clone!(@weak self as obj => move |_| {
|
||||
|
|
@ -230,7 +233,9 @@ impl LpImagePage {
|
|||
imp.error_page.set_description(Some(&gettext(
|
||||
"Either the image file is corrupted or it contains unsupported elements.",
|
||||
)));
|
||||
|
||||
imp.error_more_info.set_visible(true);
|
||||
imp.stack.set_visible_child(&*imp.error_page);
|
||||
}
|
||||
imp.stack.set_visible_child(&*imp.error_page);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@
|
|||
<object class="GtkButton">
|
||||
<property name="icon-name">object-rotate-left-symbolic</property>
|
||||
<property name="tooltip-text" translatable="yes">Rotate Left</property>
|
||||
<property name="action-name">win.rotate_ccw</property>
|
||||
<property name="action-name">win.rotate-ccw</property>
|
||||
<style>
|
||||
<class name="flat" />
|
||||
</style>
|
||||
|
|
@ -113,7 +113,7 @@
|
|||
<object class="GtkButton">
|
||||
<property name="icon-name">object-rotate-right-symbolic</property>
|
||||
<property name="tooltip-text" translatable="yes">Rotate Right</property>
|
||||
<property name="action-name">win.rotate_cw</property>
|
||||
<property name="action-name">win.rotate-cw</property>
|
||||
<style>
|
||||
<class name="flat" />
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue