Skip to content

Commit 4a6a35e

Browse files
committed
fix tabs
1 parent 86b5d2f commit 4a6a35e

File tree

5 files changed

+231
-231
lines changed

5 files changed

+231
-231
lines changed

src/Application.vala

Lines changed: 77 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -4,81 +4,81 @@
44
*/
55

66
public class AppGenerator : Gtk.Application {
7-
public MainWindow main_window;
8-
9-
public static AppGenerator _instance = null;
10-
public static AppGenerator instance {
11-
get {
12-
if (_instance == null) {
13-
_instance = new AppGenerator ();
14-
}
15-
return _instance;
16-
}
17-
}
18-
19-
20-
public AppGenerator () {
21-
Object (
22-
application_id: "io.github.ellie_commons.app-generator",
23-
flags: ApplicationFlags.FLAGS_NONE
24-
);
25-
}
26-
27-
protected override void startup () {
28-
base.startup ();
29-
30-
Granite.init ();
31-
32-
Intl.setlocale (LocaleCategory.ALL, "");
33-
Intl.bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
34-
Intl.bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
35-
Intl.textdomain (GETTEXT_PACKAGE);
36-
37-
var quit_action = new SimpleAction ("quit", null);
38-
39-
add_action (quit_action);
40-
set_accels_for_action ("app.quit", {"<Control>q"});
41-
42-
quit_action.activate.connect (quit);
43-
}
44-
45-
protected override void activate () {
46-
if (main_window != null) {
47-
main_window.present ();
48-
return;
49-
}
50-
51-
var main_window = new MainWindow (this);
52-
53-
/*
54-
* This is very finicky. Bind size after present else set_titlebar gives us bad sizes
55-
* Set maximize after height/width else window is min size on unmaximize
56-
* Bind maximize as SET else get get bad sizes
57-
*/
58-
var settings = new Settings ("io.github.ellie_commons.app-generator");
59-
settings.bind ("window-height", main_window, "default-height", SettingsBindFlags.DEFAULT);
60-
settings.bind ("window-width", main_window, "default-width", SettingsBindFlags.DEFAULT);
61-
62-
if (settings.get_boolean ("window-maximized")) {
63-
main_window.maximize ();
64-
}
65-
66-
settings.bind ("window-maximized", main_window, "maximized", SettingsBindFlags.SET);
67-
68-
// Use Css
69-
var provider = new Gtk.CssProvider ();
70-
provider.load_from_resource ("/io/github/ellie_commons/app-generator/Application.css");
71-
72-
Gtk.StyleContext.add_provider_for_display (
73-
Gdk.Display.get_default (),
74-
provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
75-
);
76-
77-
main_window.present ();
78-
}
79-
80-
public static int main (string[] args) {
81-
AppGenerator app = AppGenerator.instance;
82-
return app.run (args);
83-
}
7+
public MainWindow main_window;
8+
9+
public static AppGenerator _instance = null;
10+
public static AppGenerator instance {
11+
get {
12+
if (_instance == null) {
13+
_instance = new AppGenerator ();
14+
}
15+
return _instance;
16+
}
17+
}
18+
19+
20+
public AppGenerator () {
21+
Object (
22+
application_id: "io.github.ellie_commons.app-generator",
23+
flags: ApplicationFlags.FLAGS_NONE
24+
);
25+
}
26+
27+
protected override void startup () {
28+
base.startup ();
29+
30+
Granite.init ();
31+
32+
Intl.setlocale (LocaleCategory.ALL, "");
33+
Intl.bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
34+
Intl.bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
35+
Intl.textdomain (GETTEXT_PACKAGE);
36+
37+
var quit_action = new SimpleAction ("quit", null);
38+
39+
add_action (quit_action);
40+
set_accels_for_action ("app.quit", {"<Control>q"});
41+
42+
quit_action.activate.connect (quit);
43+
}
44+
45+
protected override void activate () {
46+
if (main_window != null) {
47+
main_window.present ();
48+
return;
49+
}
50+
51+
var main_window = new MainWindow (this);
52+
53+
/*
54+
* This is very finicky. Bind size after present else set_titlebar gives us bad sizes
55+
* Set maximize after height/width else window is min size on unmaximize
56+
* Bind maximize as SET else get get bad sizes
57+
*/
58+
var settings = new Settings ("io.github.ellie_commons.app-generator");
59+
settings.bind ("window-height", main_window, "default-height", SettingsBindFlags.DEFAULT);
60+
settings.bind ("window-width", main_window, "default-width", SettingsBindFlags.DEFAULT);
61+
62+
if (settings.get_boolean ("window-maximized")) {
63+
main_window.maximize ();
64+
}
65+
66+
settings.bind ("window-maximized", main_window, "maximized", SettingsBindFlags.SET);
67+
68+
// Use Css
69+
var provider = new Gtk.CssProvider ();
70+
provider.load_from_resource ("/io/github/ellie_commons/app-generator/Application.css");
71+
72+
Gtk.StyleContext.add_provider_for_display (
73+
Gdk.Display.get_default (),
74+
provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
75+
);
76+
77+
main_window.present ();
78+
}
79+
80+
public static int main (string[] args) {
81+
AppGenerator app = AppGenerator.instance;
82+
return app.run (args);
83+
}
8484
}

0 commit comments

Comments
 (0)