Skip to content

Commit

Permalink
ibus-ui-gtk3: Draw gray color on PropertyPanel handle
Browse files Browse the repository at this point in the history
Users can move the position of IBus PropertyPanel with the mouse
but currently it is too hard to find the handle on the panel.
Now the handle is drawn by the gray color for the visibility.

TEST=ui/gtk3/ibus-ui-gtk3

Review URL: https://codereview.appspot.com/219520043
  • Loading branch information
fujiwarat committed Apr 1, 2015
1 parent eb4ffa1 commit 020bd45
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion ui/gtk3/handle.vala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*
* ibus - The Input Bus
*
* Copyright(c) 2011 Peng Huang <shawn.p.huang@gmail.com>
* Copyright(c) 2011-2015 Peng Huang <shawn.p.huang@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -36,6 +36,19 @@ class Handle : Gtk.EventBox {
Gdk.EventMask.BUTTON1_MOTION_MASK;
set_events(mask);
m_move_begined = false;

// Currently it is too hard to notice this Handle on PropertyPanel
// so now this widget is drawn by the gray color for the visibility.
Gtk.CssProvider css_provider = new Gtk.CssProvider();
try {
css_provider.load_from_data(
"GtkEventBox { background-color: gray }", -1);
} catch (GLib.Error error) {
warning("Parse error in Handle: %s", error.message);
}
Gtk.StyleContext context = get_style_context();
context.add_provider(css_provider,
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
}

public override void realize() {
Expand Down

0 comments on commit 020bd45

Please sign in to comment.