Skip to content

Commit

Permalink
Use Granite.init to load styles (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
danirabbit authored Oct 23, 2023
1 parent 4cc1c39 commit 36c9d39
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ See the current temperature and weather conditions for your location with this m

You'll need the following dependencies to build:
* libgeoclue-2-dev
* libgranite-7-dev
* libgranite-7-dev >= 7.3.0
* libgtk-4-dev
* libgweather-4-dev
* meson
Expand All @@ -18,13 +18,14 @@ You'll need the following dependencies to build:
You'll need the following dependencies to run:
* geoclue-2.0

Run `meson build` to configure the build environment and run `ninja test` to build
Run `flatpak-builder` to configure the build environment, download dependencies, build, and install

meson build --prefix=/usr
cd build
ninja
```bash
flatpak-builder build io.github.danirabbit.nimbus.json --user --install --force-clean --install-deps-from=appcenter
```

To install, use `ninja install`, then execute with `io.github.danirabbit.nimbus`
Then execute with

ninja install
io.github.danirabbit.nimbus
```bash
flatpak run io.github.danirabbit.nimbus
```
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ executable(
dependency('glib-2.0'),
dependency('gobject-2.0'),
dependency('gtk4'),
dependency('granite-7'),
dependency('granite-7', version: '>=7.3.0'),
dependency('gweather4'),
dependency('libgeoclue-2.0')
],
Expand Down
6 changes: 2 additions & 4 deletions src/Application.vala
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ public class Nimbus : Gtk.Application {
}

protected override void startup () {
Granite.init ();

Intl.setlocale (LocaleCategory.ALL, "");
Intl.bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
Intl.bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
Expand All @@ -29,10 +31,6 @@ public class Nimbus : Gtk.Application {

protected override void activate () {
if (active_window == null) {
var provider = new Gtk.CssProvider ();
provider.load_from_resource ("io/github/danirabbit/nimbus/Application.css");
Gtk.StyleContext.add_provider_for_display (Gdk.Display.get_default (), provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);

add_window (new MainWindow ());
}

Expand Down

0 comments on commit 36c9d39

Please sign in to comment.