Skip to content
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

Closed
wants to merge 4 commits into from

Conversation

ryonakano
Copy link
Contributor

Fixes #52

I tried not to change the visual so the appearance of the dialog is completely the same.

@treppenwitz03
Copy link

Works well for me. But the large space in the bottom is undraggable, which is to be expected.

@ryonakano
Copy link
Contributor Author

Now the bottom area also should be draggable.

Copy link

@treppenwitz03 treppenwitz03 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works fine for me!

src/AppChooser/Dialog.vala Outdated Show resolved Hide resolved
src/AppChooser/Dialog.vala Outdated Show resolved Hide resolved
var grid = new Gtk.Grid () {
orientation = Gtk.Orientation.VERTICAL,
column_spacing = 12,
row_spacing = 6,
margin = 12
Copy link
Contributor

Choose a reason for hiding this comment

The 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).

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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.

Copy link
Contributor

@Marukesu Marukesu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm unsure about merging this PR, since the issue this fix isn't reproducible with the Gtk4 branch. but i won't be against if it still wanted.

expand = true
vexpand = true,
hexpand = true,
activate_on_single_click = false
Copy link
Contributor

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.

Comment on lines +145 to +146
var window_handle_top = new Hdy.WindowHandle ();
window_handle_top.add (top_grid);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
var window_handle_top = new Hdy.WindowHandle ();
window_handle_top.add (top_grid);
var window_handle_top = new Hdy.WindowHandle () {
child = top_grid
};

the same for the window_handle_bottom.

Comment on lines +148 to +156
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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

frame should be added directly in the final box.

var button_box = new Gtk.ButtonBox (Gtk.Orientation.HORIZONTAL) {
layout_style = Gtk.ButtonBoxStyle.END,
margin_top = 12,
margin = 12,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
margin = 12,
margin_top = 6,
margin_start = 12,
margin_end = 12,
margin_bottom = 12,

Comment on lines +136 to +138
margin_start = 12,
margin_end = 12,
margin_top = 12
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
margin_start = 12,
margin_end = 12,
margin_top = 12
margin_top = 12,
margin_start = 12,
margin_end = 12,
margin_bottom = 6

Comment on lines +172 to +174
box.pack_start (window_handle_top, false, false);
box.pack_start (content_grid);
box.pack_start (window_handle_bottom, false, false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be add() anyway, pack_start() was removed/renamed in Gtk4, also child properties too, so it's better to keep using add() in this case.


add (window_handle);
add (box);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
add (box);
child = box;

@danirabbit danirabbit mentioned this pull request Jan 15, 2023
4 tasks
@ryonakano ryonakano deleted the ryonakano/listbox-selectable branch January 16, 2023 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AppChooser doesn't work with mouse
3 participants