Merge lp:~vikoadi/pantheon-plugs/expand-color-panel into lp:~elementary-apps/pantheon-plugs/dynamic-gcc-plug-freya

Proposed by Viko Adi Rahmawan
Status: Merged
Merged at revision: 63
Proposed branch: lp:~vikoadi/pantheon-plugs/expand-color-panel
Merge into: lp:~elementary-apps/pantheon-plugs/dynamic-gcc-plug-freya
Diff against target: 37 lines (+17/-0)
1 file modified
plugs/Color/ColorPlug.vala (+17/-0)
To merge this branch: bzr merge lp:~vikoadi/pantheon-plugs/expand-color-panel
Reviewer Review Type Date Requested Status
elementary Apps team Pending
Review via email: mp+235688@code.launchpad.net

Description of the change

expand color panel treeview

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugs/Color/ColorPlug.vala'
2--- plugs/Color/ColorPlug.vala 2014-04-14 17:14:38 +0000
3+++ plugs/Color/ColorPlug.vala 2014-09-23 18:08:44 +0000
4@@ -24,6 +24,7 @@
5
6 private Cc.Panel panel;
7 private Gtk.Grid main_grid;
8+ private Gtk.TreeView tree;
9
10 public Plug () {
11 Object (category: Category.HARDWARE,
12@@ -54,10 +55,26 @@
13 } else {
14 panel = Object.new(GLib.Type.from_name ("CcColorPanel")) as Cc.Panel;
15 }
16+ //It's hacky but needed to have it looking good…
17+ //needed so that the treeview expand
18+ search_treeview ((Cc.Panel) panel);
19+ if (tree != null)
20+ tree.expand = true;
21+
22 main_grid.attach (panel, 0, 1, 1, 1);
23 main_grid.show_all ();
24 }
25
26+ //find treeview and put it to tree variable
27+ private void search_treeview (Gtk.Container bin) {
28+ foreach (Gtk.Widget child in bin.get_children ()) {
29+ if (child is Gtk.TreeView)
30+ tree = (Gtk.TreeView) child;
31+ else if (child is Gtk.Container)
32+ search_treeview ((Gtk.Container)child);
33+ }
34+ }
35+
36 public override void hidden () {
37 }
38

Subscribers

People subscribed via source and target branches