Only use Adw.AboutWindow for Adwaita >= 1.2

This commit is contained in:
fiaxh 2023-01-06 17:24:52 +01:00 committed by Marvin W
parent ef98adb18a
commit 6a182ba313
No known key found for this signature in database
GPG key ID: 072E9235DB996F2A
2 changed files with 24 additions and 15 deletions

View file

@ -111,6 +111,9 @@ set(MAIN_DEFINITIONS)
if(GTK4_VERSION VERSION_GREATER_EQUAL "4.6") if(GTK4_VERSION VERSION_GREATER_EQUAL "4.6")
set(MAIN_DEFINITIONS ${MAIN_DEFINITIONS} GTK_4_6) set(MAIN_DEFINITIONS ${MAIN_DEFINITIONS} GTK_4_6)
endif() endif()
if(Adwaita_VERSION VERSION_GREATER_EQUAL "1.2")
set(MAIN_DEFINITIONS ${MAIN_DEFINITIONS} Adw_1_2)
endif()
vala_precompile(MAIN_VALA_C vala_precompile(MAIN_VALA_C
SOURCES SOURCES

View file

@ -272,24 +272,30 @@ public class Dino.Ui.Application : Adw.Application, Dino.Application {
case "0.3": version = @"$version - <span font_style='italic'>Theikenmeer</span>"; break; case "0.3": version = @"$version - <span font_style='italic'>Theikenmeer</span>"; break;
} }
} }
Adw.AboutWindow about = new Adw.AboutWindow(); #if Adw_1_2
about.destroy_with_parent = true; Adw.AboutWindow about_window = new Adw.AboutWindow();
about.transient_for = window; about_window.application_icon = "im.dino.Dino";
about.modal = true; about_window.application_name = "Dino";
about.title = _("About Dino"); #else
Gtk.AboutDialog about_window = new Gtk.AboutDialog();
about.application_icon = "im.dino.Dino"; about_window.logo_icon_name = "im.dino.Dino";
about.application_name = "Dino"; about_window.program_name = "Dino";
about.version = version; about_window.website_label = "dino.im";
about.comments = "Dino. Communicating happiness."; #endif
about.website = "https://dino.im/"; about_window.destroy_with_parent = true;
about.copyright = "Copyright © 2016-2022 - Dino Team"; about_window.transient_for = window;
about.license_type = License.GPL_3_0; about_window.modal = true;
about_window.title = _("About Dino");
about_window.version = version;
about_window.comments = "Dino. Communicating happiness.";
about_window.website = "https://dino.im/";
about_window.copyright = "Copyright © 2016-2022 - Dino Team";
about_window.license_type = License.GPL_3_0;
if (!use_csd()) { if (!use_csd()) {
about.set_titlebar(null); about_window.set_titlebar(null);
} }
about.present(); about_window.present();
} }
private void show_join_muc_dialog(Account? account, string jid) { private void show_join_muc_dialog(Account? account, string jid) {