Use constants for icon size
This commit is contained in:
parent
c3d30177b1
commit
2fe5b0a249
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -9,6 +9,7 @@ dependencies = [
|
|||||||
"glib 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"glib 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"glib-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"glib-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"gtk 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"gtk 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"gtk-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"neovim-lib 0.2.0 (git+https://github.com/daa84/neovim-lib)",
|
"neovim-lib 0.2.0 (git+https://github.com/daa84/neovim-lib)",
|
||||||
"pango 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"pango 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"pangocairo 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"pangocairo 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -26,3 +26,7 @@ phf_codegen = "0.7"
|
|||||||
version = "0.1"
|
version = "0.1"
|
||||||
features = ["v3_10"]
|
features = ["v3_10"]
|
||||||
|
|
||||||
|
[dependencies.gtk-sys]
|
||||||
|
version = "0.3"
|
||||||
|
features = ["v3_10"]
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
extern crate gtk;
|
extern crate gtk;
|
||||||
|
extern crate gtk_sys;
|
||||||
extern crate gio;
|
extern crate gio;
|
||||||
extern crate gdk;
|
extern crate gdk;
|
||||||
extern crate gdk_sys;
|
extern crate gdk_sys;
|
||||||
|
@ -10,6 +10,7 @@ use pango::FontDescription;
|
|||||||
use gtk;
|
use gtk;
|
||||||
use gtk::prelude::*;
|
use gtk::prelude::*;
|
||||||
use gtk::{ApplicationWindow, HeaderBar, DrawingArea, ToolButton, Image};
|
use gtk::{ApplicationWindow, HeaderBar, DrawingArea, ToolButton, Image};
|
||||||
|
use gtk_sys;
|
||||||
use gdk::{ModifierType, Event, EventKey, EventConfigure, EventButton, EventMotion, EventType};
|
use gdk::{ModifierType, Event, EventKey, EventConfigure, EventButton, EventMotion, EventType};
|
||||||
use gdk_sys;
|
use gdk_sys;
|
||||||
use glib;
|
use glib;
|
||||||
@ -95,12 +96,12 @@ impl Ui {
|
|||||||
pub fn init(&mut self, app: >k::Application) {
|
pub fn init(&mut self, app: >k::Application) {
|
||||||
self.header_bar.set_show_close_button(true);
|
self.header_bar.set_show_close_button(true);
|
||||||
|
|
||||||
let save_image = Image::new_from_icon_name("document-save", 50);
|
let save_image = Image::new_from_icon_name("document-save", gtk_sys::GTK_ICON_SIZE_SMALL_TOOLBAR as i32);
|
||||||
let save_btn = ToolButton::new(Some(&save_image), None);
|
let save_btn = ToolButton::new(Some(&save_image), None);
|
||||||
save_btn.connect_clicked(|_| edit_save_all());
|
save_btn.connect_clicked(|_| edit_save_all());
|
||||||
self.header_bar.pack_start(&save_btn);
|
self.header_bar.pack_start(&save_btn);
|
||||||
|
|
||||||
let paste_image = Image::new_from_icon_name("edit-paste", 50);
|
let paste_image = Image::new_from_icon_name("edit-paste", gtk_sys::GTK_ICON_SIZE_SMALL_TOOLBAR as i32);
|
||||||
let paste_btn = ToolButton::new(Some(&paste_image), None);
|
let paste_btn = ToolButton::new(Some(&paste_image), None);
|
||||||
paste_btn.connect_clicked(|_| edit_paste());
|
paste_btn.connect_clicked(|_| edit_paste());
|
||||||
self.header_bar.pack_start(&paste_btn);
|
self.header_bar.pack_start(&paste_btn);
|
||||||
|
Loading…
Reference in New Issue
Block a user