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
=== modified file 'extensions/open-with.vala'
--- extensions/open-with.vala 2014-03-15 20:43:57 +0000
+++ extensions/open-with.vala 2015-03-24 03:15:27 +0000
@@ -375,7 +375,7 @@
375#endif375#endif
376 destroy_with_parent = true;376 destroy_with_parent = true;
377 set_icon_name (Gtk.STOCK_OPEN);377 set_icon_name (Gtk.STOCK_OPEN);
378 resizable = false;378 resizable = true;
379 add_buttons (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,379 add_buttons (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
380 Gtk.STOCK_OPEN, Gtk.ResponseType.ACCEPT);380 Gtk.STOCK_OPEN, Gtk.ResponseType.ACCEPT);
381381
@@ -391,6 +391,15 @@
391 vbox.pack_start (chooser, true, true, 0);391 vbox.pack_start (chooser, true, true, 0);
392392
393 get_content_area ().show_all ();393 get_content_area ().show_all ();
394
395 Gtk.Requisition req;
396#if HAVE_GTK3
397 get_content_area ().get_preferred_size (null, out req);
398#else
399 get_content_area ().size_request (out req);
400#endif
401 (this as Gtk.Window).set_default_size (req.width*2, req.height*3/2);
402
394 set_default_response (Gtk.ResponseType.ACCEPT);403 set_default_response (Gtk.ResponseType.ACCEPT);
395 chooser.selected.connect ((app_info) => {404 chooser.selected.connect ((app_info) => {
396 response (Gtk.ResponseType.ACCEPT);405 response (Gtk.ResponseType.ACCEPT);
@@ -439,6 +448,7 @@
439 update_label ();448 update_label ();
440449
441 clicked.connect (() => {450 clicked.connect (() => {
451 dialog.transient_for = this.get_toplevel () as Gtk.Window;
442 app_info = dialog.open_with ();452 app_info = dialog.open_with ();
443 string new_commandline = app_info != null ? get_commandline (app_info) : null;453 string new_commandline = app_info != null ? get_commandline (app_info) : null;
444 commandline = new_commandline;454 commandline = new_commandline;

Subscribers

People subscribed via source and target branches

to all changes: