Skip to content

Commit

Permalink
feat(gxi): set gxi's icon as window icon
Browse files Browse the repository at this point in the history
  • Loading branch information
Cogitri committed Jun 1, 2019
1 parent 953f826 commit 1d0f0a3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/gxi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ enclose = "1"
env_logger = "0.6"
failure = "0.1"
gdk = { git="https://github.com/gtk-rs/gdk" }
gdk-pixbuf = { git="https://github.com/gtk-rs/gdk-pixbuf" }
gettext-rs = { version="0.4", features=["gettext-system"] }
gio = { git="https://github.com/gtk-rs/gio" }
glib = { git="https://github.com/gtk-rs/glib" }
Expand Down
4 changes: 4 additions & 0 deletions src/gxi/src/main_win.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use crate::about_win::AboutWin;
use crate::errors::ErrorDialog;
use crate::prefs_win::PrefsWin;
use editview::{theme::u32_from_color, theme::LineStyle, EditView, MainState, Settings};
use gdk_pixbuf::Pixbuf;
use gettextrs::gettext;
use gio::{ActionMapExt, ApplicationExt, Resource, SettingsExt, SimpleAction};
use glib::{Bytes, MainContext};
Expand Down Expand Up @@ -98,6 +99,9 @@ impl MainWin {
let properties = RefCell::new(WinProp::new(&application));
let window: ApplicationWindow = builder.get_object("appwindow").unwrap();

let icon = Pixbuf::new_from_resource("/com/github/Cogitri/gxi/com.github.Cogitri.gxi.svg");
window.set_icon(icon.ok().as_ref());

if properties.borrow().is_maximized {
window.maximize();
} else {
Expand Down
1 change: 1 addition & 0 deletions src/gxi/src/ui/resources.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
<gresource prefix="/com/github/Cogitri/gxi/">
<file preprocess="xml-stripblanks">gxi.glade</file>
<file preprocess="xml-stripblanks">prefs_win.glade</file>
<file>../../../../data/icons//hicolor/scalable/apps/com.github.Cogitri.gxi.svg</file>
</gresource>
</gresources>

0 comments on commit 1d0f0a3

Please sign in to comment.