Skip to content

Commit

Permalink
added pixmaps for ok and cancel, made small adjustments to EditableLabel
Browse files Browse the repository at this point in the history
  • Loading branch information
naxuroqa committed May 21, 2014
1 parent bcb5aa9 commit c98d4b4
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 4 deletions.
6 changes: 6 additions & 0 deletions misc/svg/cancel.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions misc/svg/ok.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions src/core/ResourceFactory.vala
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ namespace Venom {
string pixmaps_prefix = "/org/gtk/venom/pixmaps/";
string theme_folder = Path.build_filename(Tools.find_data_dir(), "theme");

ok = load_image_from_resource(pixmaps_prefix + "ok.png");
cancel = load_image_from_resource(pixmaps_prefix + "cancel.png");

away = load_image_from_resource(pixmaps_prefix + "away.png");
away_glow = load_image_from_resource(pixmaps_prefix + "away_glow.png");
busy = load_image_from_resource(pixmaps_prefix + "busy.png");
Expand Down Expand Up @@ -72,6 +75,8 @@ namespace Venom {
default_statusmessage = "Toxing on Venom v.%s".printf(Config.VERSION);
}

public Gdk.Pixbuf ok {get; private set;}
public Gdk.Pixbuf cancel {get; private set;}

public Gdk.Pixbuf away {get; private set;}
public Gdk.Pixbuf away_glow {get; private set;}
Expand Down
Binary file added src/pixmaps/cancel.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/pixmaps/ok.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/pixmaps/venom_pixmaps.gresource.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@
<file>busy_glow.png</file>
<file>call.png</file>
<file>call_video.png</file>
<file>cancel.png</file>
<file>send_file.png</file>
<file>default_contact.png</file>
<file>default_groupchat.png</file>
<file>groupchat.png</file>
<file>offline.png</file>
<file>offline_glow.png</file>
<file>ok.png</file>
<file>online.png</file>
<file>online_glow.png</file>
<file>settings.png</file>
Expand Down
13 changes: 9 additions & 4 deletions src/ui/EditableLabel.vala
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ namespace Venom {
}

public void show_entry() {
//FIXME define GTK_<MAJOR>_<MINOR> in cmake instead of using glib version
#if GLIB_2_34
entry.attributes = label.attributes;
#endif
box_label.visible = false;
box_entry.no_show_all = false;
box_entry.show_all();
Expand All @@ -61,18 +65,19 @@ namespace Venom {
button_cancel = new Gtk.Button();

entry.has_frame = false;
entry.width_chars = 10;

button_ok.add(new Gtk.Image.from_icon_name("gtk-ok", Gtk.IconSize.MENU));
button_cancel.add(new Gtk.Image.from_icon_name("gtk-cancel", Gtk.IconSize.MENU));
button_ok.add(new Gtk.Image.from_pixbuf(ResourceFactory.instance.ok));
button_cancel.add(new Gtk.Image.from_pixbuf(ResourceFactory.instance.cancel));

Gtk.Box box = new Gtk.Box(Gtk.Orientation.VERTICAL, 0);
box_label = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0);
box_entry = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0);

box_label.pack_start(label);
box_entry.pack_start(entry);
box_entry.pack_start(button_ok);
box_entry.pack_start(button_cancel);
box_entry.pack_start(button_ok, false);
box_entry.pack_start(button_cancel, false);
box.pack_start(box_label);
box.pack_start(box_entry);

Expand Down

0 comments on commit c98d4b4

Please sign in to comment.