-
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AppChooser: Fix listbox being unselectable #60
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -110,7 +110,9 @@ public class AppChooser.Dialog : Hdy.Window { | |||||||||||||||
placeholder.show_all (); | ||||||||||||||||
|
||||||||||||||||
listbox = new Gtk.ListBox () { | ||||||||||||||||
expand = true | ||||||||||||||||
vexpand = true, | ||||||||||||||||
hexpand = true, | ||||||||||||||||
activate_on_single_click = false | ||||||||||||||||
}; | ||||||||||||||||
listbox.set_placeholder (placeholder); | ||||||||||||||||
|
||||||||||||||||
|
@@ -127,32 +129,51 @@ public class AppChooser.Dialog : Hdy.Window { | |||||||||||||||
}; | ||||||||||||||||
open_button.get_style_context ().add_class (Gtk.STYLE_CLASS_SUGGESTED_ACTION); | ||||||||||||||||
|
||||||||||||||||
var top_grid = new Gtk.Grid () { | ||||||||||||||||
orientation = Gtk.Orientation.VERTICAL, | ||||||||||||||||
column_spacing = 12, | ||||||||||||||||
row_spacing = 6, | ||||||||||||||||
margin_start = 12, | ||||||||||||||||
margin_end = 12, | ||||||||||||||||
margin_top = 12 | ||||||||||||||||
Comment on lines
+136
to
+138
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||
}; | ||||||||||||||||
|
||||||||||||||||
top_grid.attach (overlay, 0, 0, 1, 2); | ||||||||||||||||
top_grid.attach (primary_label, 1, 0); | ||||||||||||||||
top_grid.attach (secondary_label, 1, 1); | ||||||||||||||||
|
||||||||||||||||
var window_handle_top = new Hdy.WindowHandle (); | ||||||||||||||||
window_handle_top.add (top_grid); | ||||||||||||||||
Comment on lines
+145
to
+146
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
the same for the |
||||||||||||||||
|
||||||||||||||||
var content_grid = new Gtk.Grid () { | ||||||||||||||||
orientation = Gtk.Orientation.VERTICAL, | ||||||||||||||||
column_spacing = 12, | ||||||||||||||||
row_spacing = 6, | ||||||||||||||||
margin_start = 12, | ||||||||||||||||
margin_end = 12 | ||||||||||||||||
}; | ||||||||||||||||
|
||||||||||||||||
content_grid.attach (frame, 0, 0); | ||||||||||||||||
Comment on lines
+148
to
+156
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||||||||||||
|
||||||||||||||||
var button_box = new Gtk.ButtonBox (Gtk.Orientation.HORIZONTAL) { | ||||||||||||||||
layout_style = Gtk.ButtonBoxStyle.END, | ||||||||||||||||
margin_top = 12, | ||||||||||||||||
margin = 12, | ||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||
spacing = 6 | ||||||||||||||||
}; | ||||||||||||||||
|
||||||||||||||||
button_box.add (cancel); | ||||||||||||||||
button_box.add (open_button); | ||||||||||||||||
|
||||||||||||||||
var grid = new Gtk.Grid () { | ||||||||||||||||
orientation = Gtk.Orientation.VERTICAL, | ||||||||||||||||
column_spacing = 12, | ||||||||||||||||
row_spacing = 6, | ||||||||||||||||
margin = 12 | ||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why remove the margin here? the logic here is that this set the external margins, so that the header and button box only need to deal with the internal margins (margin_botton for the header and margin_top for the button box). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Leaving this 12px means the 4 edges of the dialog won't receive the key press events like the secondary click for the context menu and dragging for window movement. So I moved all margins into each grid. I'm not sure if these changes I made is correct though. |
||||||||||||||||
}; | ||||||||||||||||
var window_handle_bottom = new Hdy.WindowHandle (); | ||||||||||||||||
window_handle_bottom.add (button_box); | ||||||||||||||||
|
||||||||||||||||
grid.attach (overlay, 0, 0, 1, 2); | ||||||||||||||||
grid.attach (primary_label, 1, 0); | ||||||||||||||||
grid.attach (secondary_label, 1, 1); | ||||||||||||||||
grid.attach (frame, 0, 3, 2); | ||||||||||||||||
grid.attach (button_box, 1, 4); | ||||||||||||||||
var box = new Gtk.Box (Gtk.Orientation.VERTICAL, 6); | ||||||||||||||||
|
||||||||||||||||
var window_handle = new Hdy.WindowHandle (); | ||||||||||||||||
window_handle.add (grid); | ||||||||||||||||
box.pack_start (window_handle_top, false, false); | ||||||||||||||||
box.pack_start (content_grid); | ||||||||||||||||
box.pack_start (window_handle_bottom, false, false); | ||||||||||||||||
Comment on lines
+172
to
+174
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this should be |
||||||||||||||||
|
||||||||||||||||
add (window_handle); | ||||||||||||||||
add (box); | ||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||
type_hint = Gdk.WindowTypeHint.DIALOG; | ||||||||||||||||
default_height = 400; | ||||||||||||||||
default_width = 350; | ||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about unsetting
activate_on_single_click
, i would prefer that we handle activating/selecting the row by ourselves in the::row_activated
signal.