Adjust ShortcutsWindow + AboutDialog for non-CSD mode

This commit is contained in:
fiaxh 2021-03-05 12:21:04 -06:00
parent 2630f18631
commit 80498c7e37

View file

@ -185,7 +185,16 @@ public class Dino.Ui.Application : Gtk.Application, Dino.Application {
SimpleAction open_shortcuts_action = new SimpleAction("open_shortcuts", null); SimpleAction open_shortcuts_action = new SimpleAction("open_shortcuts", null);
open_shortcuts_action.activate.connect((variant) => { open_shortcuts_action.activate.connect((variant) => {
Builder builder = new Builder.from_resource("/im/dino/Dino/shortcuts.ui"); Builder builder = new Builder.from_resource("/im/dino/Dino/shortcuts.ui");
var dialog = (ShortcutsWindow) builder.get_object("shortcuts-window"); ShortcutsWindow dialog = (ShortcutsWindow) builder.get_object("shortcuts-window");
if (!use_csd()) {
// Hack to prevent CRITICAL in Gtk when trying to destroy non-existant headerbar
Widget shortcuts_hack = dialog.get_titlebar();
dialog.destroy.connect_after(() => {
shortcuts_hack = null;
});
dialog.set_titlebar(null);
}
dialog.title = _("Keyboard Shortcuts");
dialog.set_transient_for(get_active_window()); dialog.set_transient_for(get_active_window());
dialog.present(); dialog.present();
}); });
@ -217,15 +226,25 @@ public class Dino.Ui.Application : Gtk.Application, Dino.Application {
case "0.2": version = @"$version - <span font_style='italic'>Mexican Caribbean Coral Reefs</span>"; break; case "0.2": version = @"$version - <span font_style='italic'>Mexican Caribbean Coral Reefs</span>"; break;
} }
} }
show_about_dialog(get_active_window(), Gtk.AboutDialog dialog = new Gtk.AboutDialog();
logo_icon_name: "im.dino.Dino", dialog.destroy_with_parent = true;
program_name: "Dino", dialog.transient_for = window;
version: version, dialog.modal = true;
comments: "Dino. Communicating happiness.", dialog.title = _("About Dino");
website: "https://dino.im/",
website_label: "dino.im", dialog.logo_icon_name = "im.dino.Dino";
copyright: "Copyright © 2016-2020 - Dino Team", dialog.program_name = "Dino";
license_type: License.GPL_3_0); dialog.version = version;
dialog.comments = "Dino. Communicating happiness.";
dialog.website = "https://dino.im/";
dialog.website_label = "dino.im";
dialog.copyright = "Copyright © 2016-2021 - Dino Team";
dialog.license_type = License.GPL_3_0;
if (!use_csd()) {
dialog.set_titlebar(null);
}
dialog.present();
} }
private void show_join_muc_dialog(Account? account, string jid) { private void show_join_muc_dialog(Account? account, string jid) {