Merge lp:~gue5t/midori/app-resize into lp:midori

Proposed by gue5t gue5t
Status: Merged
Approved by: Danielle Foré
Approved revision: 6908
Merged at revision: 6908
Proposed branch: lp:~gue5t/midori/app-resize
Merge into: lp:midori
Diff against target: 36 lines (+11/-1)
1 file modified
extensions/open-with.vala (+11/-1)
To merge this branch: bzr merge lp:~gue5t/midori/app-resize
Reviewer Review Type Date Requested Status
Danielle Foré (community) Approve
Review via email: mp+253911@code.launchpad.net

Commit message

Make application choosers resizable with a sane default size

Description of the change

Presently the chooser dialog for applications on the "open with" tab of preferences uses a fixed-size window that's uncomfortably small; it's too thin to read entire descriptions and too short to see more than two of the possibly many available applications for a given purpose.

This branch changes the dialog to be larger and resizable.

It also ensures that the dialog is always mapped with a "transient-for" parent, ensuring that it doesn't spawn outside the Midori window entirely in some window managers.

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

Changes look sane. Works in gtk2 and 3. No more warning in terminal about no parent. Good job :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'extensions/open-with.vala'
2--- extensions/open-with.vala 2014-03-15 20:43:57 +0000
3+++ extensions/open-with.vala 2015-03-24 03:15:27 +0000
4@@ -375,7 +375,7 @@
5 #endif
6 destroy_with_parent = true;
7 set_icon_name (Gtk.STOCK_OPEN);
8- resizable = false;
9+ resizable = true;
10 add_buttons (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
11 Gtk.STOCK_OPEN, Gtk.ResponseType.ACCEPT);
12
13@@ -391,6 +391,15 @@
14 vbox.pack_start (chooser, true, true, 0);
15
16 get_content_area ().show_all ();
17+
18+ Gtk.Requisition req;
19+#if HAVE_GTK3
20+ get_content_area ().get_preferred_size (null, out req);
21+#else
22+ get_content_area ().size_request (out req);
23+#endif
24+ (this as Gtk.Window).set_default_size (req.width*2, req.height*3/2);
25+
26 set_default_response (Gtk.ResponseType.ACCEPT);
27 chooser.selected.connect ((app_info) => {
28 response (Gtk.ResponseType.ACCEPT);
29@@ -439,6 +448,7 @@
30 update_label ();
31
32 clicked.connect (() => {
33+ dialog.transient_for = this.get_toplevel () as Gtk.Window;
34 app_info = dialog.open_with ();
35 string new_commandline = app_info != null ? get_commandline (app_info) : null;
36 commandline = new_commandline;

Subscribers

People subscribed via source and target branches

to all changes: