Skip to content

Commit e2248d3

Browse files
committed
Responsive AboutWindow
1 parent 9802e9a commit e2248d3

File tree

5 files changed

+26
-27
lines changed

5 files changed

+26
-27
lines changed

meson.build

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
project('accel', ['c', 'vala'],
2-
version: '0.1.0-alpha',
3-
meson_version: '>= 0.50.0',
4-
default_options: [ 'warning_level=2',
5-
],
1+
project(
2+
'accel',
3+
['c', 'vala'],
4+
version: '0.1.0-alpha',
5+
meson_version: '>= 0.50.0',
6+
default_options: [
7+
'warning_level=2',
8+
],
69
)
710

811
i18n = import('i18n')
912

10-
add_global_arguments('-DGETTEXT_PACKAGE="@0@"'.format (meson.project_name()), language:'c')
13+
add_global_arguments('-DGETTEXT_PACKAGE="@0@"'.format(meson.project_name()), '-w', language: 'c')
1114

1215
# Blueprint
1316
subproject('blueprint-compiler')
@@ -18,4 +21,3 @@ subdir('src')
1821
subdir('po')
1922

2023
meson.add_install_script('build-aux/meson/postinstall.py')
21-

src/Application.vala

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public class Terminal.Application : He.Application {
2929

3030
public Gtk.CssProvider css_provider { get; private set; }
3131

32-
private He.ApplicationWindow window;
32+
private Window window;
3333

3434
public Application () {
3535
Object (
@@ -53,7 +53,7 @@ public class Terminal.Application : He.Application {
5353

5454
protected override void startup () {
5555
Gdk.RGBA accent_color = { 0 };
56-
accent_color.parse("#2d2d2d");
56+
accent_color.parse ("#2d2d2d");
5757
default_accent_color = He.from_gdk_rgba (accent_color);
5858

5959
resource_base_path = "/com/fyralabs/Accelerator";
@@ -97,9 +97,7 @@ public class Terminal.Application : He.Application {
9797

9898
private void on_about () {
9999
var win = create_about_dialog (this.window);
100-
win.set_modal (true);
101-
win.set_transient_for (this.get_active_window ());
102-
win.show ();
100+
win.present ();
103101
}
104102

105103
private void on_new_window () {
@@ -113,4 +111,4 @@ public class Terminal.Application : He.Application {
113111
private void on_focus_previous_tab () {
114112
(this.get_active_window () as Window) ? .focus_previous_tab ();
115113
}
116-
}
114+
}

src/widgets/AboutDialog.vala

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020

2121
namespace Terminal {
22-
public He.AboutWindow create_about_dialog (Gtk.Window parent) {
22+
public He.AboutWindow create_about_dialog (Window parent) {
2323
string[] developers = {
2424
"Cappy Ishihara"
2525
};
@@ -37,16 +37,11 @@ namespace Terminal {
3737
developers,
3838
2023,
3939
He.AboutWindow.Licenses.GPLV3, He.Colors.NONE);
40-
41-
window.set_modal (true);
42-
window.set_transient_for (parent);
4340
if (DEVEL) {
4441
window.add_css_class ("devel");
4542
}
4643

47-
// window.add_link (_("Donate"), "https://www.patreon.com/raggesilver");
48-
// window.add_link (_("Full Changelog"), "https://gitlab.gnome.org/raggesilver/blackbox/-/blob/main/CHANGELOG.md");
49-
44+
parent.main_overlay.add_overlay (window);
5045
return window;
5146
}
5247

@@ -139,4 +134,4 @@ namespace Terminal {
139134

140135
return res;
141136
}
142-
}
137+
}

src/widgets/TerminalTab.vala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,7 @@ public class Terminal.TerminalTab : He.Tab {
106106
);
107107
}
108108

109-
110109
public void search () {
111110
this.search_toolbar.open ();
112111
}
113-
}
112+
}

src/widgets/Window.vala

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ public class Terminal.Window : He.ApplicationWindow {
8585

8686
BaseHeaderBar header_bar;
8787
Gtk.Revealer header_bar_revealer;
88+
public Gtk.Overlay main_overlay;
8889

8990
Gtk.HeaderBar floating_bar;
9091
Gtk.Box floating_btns;
@@ -197,7 +198,11 @@ public class Terminal.Window : He.ApplicationWindow {
197198
overlay.set_name ("accelerator-overlay");
198199
overlay.add_overlay (this.floating_header_bar_revealer);
199200

200-
this.child = overlay;
201+
main_overlay = new Gtk.Overlay ();
202+
main_overlay.child = overlay;
203+
main_overlay.add_overlay (this.floating_header_bar_revealer);
204+
205+
this.child = main_overlay;
201206

202207
this.add_css_class ("accelerator-main-window");
203208
}
@@ -232,7 +237,7 @@ public class Terminal.Window : He.ApplicationWindow {
232237
var wheight = (int) (sett.remember_window_size ? sett.window_height : 450);
233238

234239
Object (
235-
application: app,
240+
application : app,
236241
default_width: wwidth,
237242
default_height: wheight,
238243
fullscreened: sett.remember_window_size && sett.was_fullscreened,
@@ -482,7 +487,7 @@ public class Terminal.Window : He.ApplicationWindow {
482487
}
483488

484489
public void zoom_in () {
485-
this.active_terminal.zoom_in ();
490+
this.active_terminal.zoom_in ();
486491
}
487492

488493
public void zoom_out () {
@@ -652,4 +657,4 @@ public class Terminal.Window : He.ApplicationWindow {
652657
this.tab_bar.current = this.tab_bar.tabs.last ().data;
653658
}
654659
}
655-
}
660+
}

0 commit comments

Comments
 (0)