Merge lp:~elementary-pantheon/granite/about-gtk-3.14 into lp:~elementary-pantheon/granite/granite

Proposed by Danielle Foré
Status: Merged
Approved by: Danielle Foré
Approved revision: 758
Merged at revision: 757
Proposed branch: lp:~elementary-pantheon/granite/about-gtk-3.14
Merge into: lp:~elementary-pantheon/granite/granite
Diff against target: 118 lines (+3/-81)
1 file modified
lib/Widgets/AboutDialog.vala (+3/-81)
To merge this branch: bzr merge lp:~elementary-pantheon/granite/about-gtk-3.14
Reviewer Review Type Date Requested Status
Robert Roth (community) Approve
Danielle Foré Needs Fixing
Review via email: mp+228034@code.launchpad.net

Commit message

Remove all the custom drawing code in in Granite's About dialog

Description of the change

This branch removes a TON of crazy custom drawing stuff and uses a regular old Gtk.Dialog

To post a comment you must log in.
Revision history for this message
Danielle Foré (danrabbit) wrote :

I'm not sure why there is massive amounts of padding in the hbox. The dialog is being stretched out really wide. I tried reducing the padding, but I don't exactly know what I'm doing here :p

If someone wants to rewrite all this craziness with Gtk.Grid that would probably be cool

Revision history for this message
Danielle Foré (danrabbit) wrote :

Corentin says to revert the changes regarding action area since this was just recently addressed upstream in Gtk

review: Needs Fixing
Revision history for this message
Danielle Foré (danrabbit) wrote :

I reverted changes to the way buttons are added to the action area :)

Revision history for this message
Robert Roth (evfool) wrote :

Looks ok, tested the changes, it works as expected, but with much less code.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/Widgets/AboutDialog.vala'
2--- lib/Widgets/AboutDialog.vala 2014-04-05 08:35:38 +0000
3+++ lib/Widgets/AboutDialog.vala 2014-07-26 22:09:32 +0000
4@@ -69,53 +69,22 @@
5
6 private Granite.Drawing.BufferSurface buffer;
7
8- private const string HELP_BUTTON_STYLESHEET = """
9- .help_button {
10- border-radius: 200px;
11- }
12- """;
13-
14- int shadow_blur = 15;
15- int shadow_x = 0;
16- int shadow_y = 2;
17- double shadow_alpha = 0.3;
18-
19 /**
20 * Creates a new Granite.Widgets.AboutDialog
21 */
22 public AboutDialog () {
23 Box action_area = (Box) get_action_area ();
24
25- var draw_ref = new Gtk.Window ();
26- draw_ref.get_style_context ().add_class (StyleClass.CONTENT_VIEW_WINDOW);
27-
28- // Apply DecoratedWindow's theming
29- DecoratedWindow.set_default_theming (draw_ref);
30-
31- action_area.get_style_context ().add_class (StyleClass.CONTENT_VIEW);
32-
33- this.decorated = false;
34- this.set_visual (this.get_screen ().get_rgba_visual ());
35- this.app_paintable = true;
36-
37- action_area.margin = 4;
38- action_area.margin_bottom = 8;
39- this.get_content_area ().margin = 10;
40- this.get_content_area ().margin_top = 27;
41- this.get_content_area ().margin_bottom = 3;
42-
43 /* help button */
44 help_button = new Button.with_label ("?");
45-
46- Utils.set_theming (help_button, HELP_BUTTON_STYLESHEET, StyleClass.HELP_BUTTON,
47- Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
48+ help_button.get_style_context ().add_class ("help_button");
49
50 help_button.halign = Gtk.Align.CENTER;
51 help_button.clicked.connect (() => { activate_link(help); });
52
53 /* Circular help button */
54 help_button.size_allocate.connect ( (alloc) => {
55- help_button.set_size_request (alloc.height, -1);
56+ help_button.set_size_request (alloc.height, -1);
57 });
58
59 action_area.pack_end (help_button, false, false, 0);
60@@ -144,56 +113,9 @@
61
62 this.height_request = 282;
63
64- var w = -1;
65- var h = -1;
66- this.size_allocate.connect ( () => {
67- if (this.get_allocated_width () == w && this.get_allocated_height () == h)
68- return;
69- w = this.get_allocated_width ();
70- h = this.get_allocated_height ();
71-
72- this.buffer = new Granite.Drawing.BufferSurface (w, h);
73-
74- this.buffer.context.rectangle (shadow_blur + shadow_x,
75- shadow_blur + shadow_y, w - shadow_blur*2 + shadow_x, h - shadow_blur*2 + shadow_y);
76- this.buffer.context.set_source_rgba (0, 0, 0, shadow_alpha);
77- this.buffer.context.fill ();
78- this.buffer.exponential_blur (shadow_blur / 2);
79-
80- draw_ref.get_style_context ().render_activity (this.buffer.context, shadow_blur + shadow_x,
81- shadow_blur + shadow_y, w - shadow_blur*2 + shadow_x, h - shadow_blur*2 + shadow_y);
82-
83- });
84-
85- /*draw the buffer*/
86- this.draw.connect ( (ctx) => {
87- if (buffer == null)
88- return false;
89-
90- ctx.set_operator (Cairo.Operator.SOURCE);
91- ctx.rectangle (0, 0, w, h);
92- ctx.set_source_rgba (0, 0, 0, 0);
93- ctx.fill ();
94-
95- ctx.set_source_surface (this.buffer.surface, 0, 0);
96- ctx.paint ();
97-
98- return false;
99- });
100-
101- /*allow moving the window*/
102- this.button_press_event.connect ( (e) => {
103- if (e.button == 1) {
104- this.begin_move_drag ((int) e.button, (int) e.x_root, (int) e.y_root, e.time);
105- return true;
106- }
107- return false;
108- });
109-
110-
111 show_all ();
112 }
113 }
114
115 public extern void show_about_dialog (Gtk.Window *parent, ...);
116-}
117+}
118\ No newline at end of file

Subscribers

People subscribed via source and target branches