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

Improve some details of the main window interface #30

Merged
merged 3 commits into from
Oct 15, 2018
Merged

Conversation

soc
Copy link
Contributor

@soc soc commented Sep 8, 2018

Issues:

  • toolbar background seems to "end" in the middle of the window
  • panes are missing margins, widgets are rendered too close to each other
  • there are four ways to show package properties
    1. click "properties" button
    2. hit Alt+Return
    3. enable "show package properties in main window" in the preferences
    4. click the "properties" menu item in the "settings" menu bar

Changes:

  • fixed the missing margin between the left pane and the right pane
  • fixed the missing margin between the package list pane and the detail pane
  • moved buttons which operate on the package listing to the right ("properties", "search")
  • general operations ("update", "upgrade", "apply") are kept on the left
  • if the "show package properties in main window" setting is enabled,
    the "properties" button is hidden, reducing the amount of different
    ways package properties are be displayed

@soc
Copy link
Contributor Author

soc commented Sep 8, 2018

Hi @mvo5,
here are a few screenshots:

Before:

synaptic-old

After:

synaptic-new1

synaptic-new

Things I'd like to sort out in a follow-up PR:

  • the handle between panes needs to be hidden (the handles are the two extra lines that get rendered between the various panes)
  • overhaul "quick filter" search bar (it wasn't removed in this path, it's just not shown because I made the screenshots when I had Synaptic compiled without libept first)

Please let me know what you think!

@trebmuh
Copy link
Contributor

trebmuh commented Sep 8, 2018

I like the visual display of the last screenshot. 👍

@soc soc force-pushed the topic/gui branch 2 times, most recently from 4efd962 to a185d49 Compare September 9, 2018 17:13
@soc
Copy link
Contributor Author

soc commented Sep 9, 2018

Current progress:

synaptic-new4

@soc
Copy link
Contributor Author

soc commented Sep 9, 2018

I'm currently trying to sort out this double free: https://gist.github.com/soc/3b6531cb3e4ae68a52f4c671184e0021

I happens on startup if the setting showWelcomeDialog does not exist in synaptic.conf or is set to "1".
Help appreciated!

@mvo5
Copy link
Owner

mvo5 commented Sep 11, 2018

Hey @soc! First, great that you work on improving synaptic! Due to real-life (busyness on my side) it did not get enough love from me. So your help is super appreciated. Feel free to hop on irc as well, I'm usually around at european hours in the #synaptic channel on freenode.

[edit clarify who is busy :)]

@mvo5
Copy link
Owner

mvo5 commented Sep 11, 2018

@soc about the double free - I checked the gist and this PR and I can't reproduce it here on my 18.04 ubuntu system. However the following diff http://paste.ubuntu.com/p/6wDj7pC3sk/ (against this PR) may helper. It just switches filename to use a c++ string which removes the need to explicitly free things.

@soc
Copy link
Contributor Author

soc commented Sep 11, 2018

@mvo5 I investigated further, and it seems that the crash only appears when showWelcomeDialog is set to "1" or doesn't exist otherwise everything is fine. Basically if Synaptic decides to show the welcome dialog, it crashes ... I'll try your patch, but it feels like there is some corruption somewhere else.

@soc
Copy link
Contributor Author

soc commented Sep 13, 2018

@mvo5: Here is the crash with your patch applied:

(gdb) run
Starting program: /home/soc/code/synaptic/gtk/synaptic 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Detaching after fork from child process 13682]
[Detaching after fork from child process 13684]
[New Thread 0x7fffee16f700 (LWP 13686)]
[New Thread 0x7fffed96e700 (LWP 13687)]
[New Thread 0x7fffed16d700 (LWP 13688)]
[Detaching after fork from child process 13689]
[Detaching after fork from child process 13690]
[Detaching after fork from child process 13691]
[Thread 0x7fffed16d700 (LWP 13688) exited]

Thread 1 "synaptic" received signal SIGSEGV, Segmentation fault.
0x00007ffff750cd78 in g_type_check_instance_cast ()
   from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
(gdb) bt
#0  0x00007ffff750cd78 in g_type_check_instance_cast ()
    at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#1  0x00005555555ab140 in RGGtkBuilderUserDialog::init(char const*)
    (this=0x7fffffffe030, name=0x5555555eb637 "welcome") at rguserdialog.cc:261
#2  0x00005555555ab28f in RGGtkBuilderUserDialog::run(char const*, bool)
    (this=this@entry=0x7fffffffe030, name=name@entry=0x5555555eb637 "welcome", return_gtk_response=return_gtk_response@entry=false) at rguserdialog.cc:282
#3  0x0000555555579330 in welcome_dialog(RGMainWindow*) (mainWindow=0x555555737a00)
    at gsynaptic.cc:165
#4  0x0000555555576e87 in main(int, char**) (argc=<optimized out>, argv=<optimized out>)
    at gsynaptic.cc:600

@soc
Copy link
Contributor Author

soc commented Sep 13, 2018

This is enough to trigger the crash for me:

Synaptic "" {
  showWelcomeDialog "1";
};

@soc
Copy link
Contributor Author

soc commented Sep 13, 2018

I might need to back out of the primary-toolbar changes in the .ui file, it appears as if it fixes issues in some themes, but breaks things in other themes ...

@soc
Copy link
Contributor Author

soc commented Sep 16, 2018

@mvo5 I think this patch is largely good to go (modulo the primary-toolbar thing), I just realized that the crash also happens on the main branch without any of my changes. :-(

@soc
Copy link
Contributor Author

soc commented Sep 16, 2018

For some reason the GtkDialog doesn't like to be cast to a GtkWindow ... maybe I'm misunderstanding something but that seems weird.

@soc
Copy link
Contributor Author

soc commented Sep 18, 2018

I think this should be good to go. I found the reason for the crashes and added a second commit fixing it: cafafca

With this change the crashes are gone.

This is how it looks now:

synaptic-end

  • There is still an additional border around the GtkNotebook in Greybird, fix pending.
  • I couldn't manage to replace the GtkTable with GtkGrid (bottom-left buttons) – the buttons became unclickable after the migration – so I didn't do that. Hints appreciated!

As shown in the screenshots, I also did a few minor things like enabling rubber banding in the package list, so it's possible to select multiple packages by pressing and dragging the mouse.

Issues:
- panes are missing margins, widgets are rendered too close to each other
- there are four ways to show package properties
  1. click "properties" button
  2. hit Alt+Return
  3. enable "show package properties in main window" in the preferences
  4. click the "properties" menu item in the "settings" menu bar

Changes:
- fix the missing margin between the left pane and the right pane
- fix the missing margin between the package list pane and the detail pane
- move buttons which operate on the package listing to the right ("properties", "search")
- general operations ("update", "upgrade", "apply") are kept on the left
- if the "show package properties in main window" setting is enabled,
  the "properties" button is hidden, reducing the amount of different
  ways package properties are displayed
- get rid of quite a few borders, making the interface a bit more light-weight
The internet claims this is undefined behavior.
This allows us to get rid of the gap between the toolbars that shows up
as "unstyled" background in some themes like Greybird.

I couldn't find a way to get the background color to display properly if
the quick search is displayed, I fear this might be a theme issue.

Experiments with the `primary-toolbar` style class shows mixed results,
so I dropped most of those changes.
@soc
Copy link
Contributor Author

soc commented Oct 8, 2018

@mvo5 Hey Michael, is there anything else that needs to be done?

@mvo5
Copy link
Owner

mvo5 commented Oct 10, 2018

Hey @soc - sorry for the delay. My day job kept me quite busy. I think this is great I did some testing and it looks good. I will go over the glade diff in detail and then this can be merged.

Synaptic would benefit greatly from more help so feel free to improve other aspects of the app :-D Lots of users will appreciate it and I'm more than happy (and hopefully also more responsive) to help.

@mvo5
Copy link
Owner

mvo5 commented Oct 10, 2018

@soc Also, if you want to be credited with a name other than "soc" in the changelog, please do let me know what name I should write there.

@soc
Copy link
Contributor Author

soc commented Oct 11, 2018

@mvo5 No problem! You can use "Simon Ochsenreither" for the changelog if you want!

Copy link
Owner

@mvo5 mvo5 left a comment

Choose a reason for hiding this comment

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

Thank you!

@mvo5 mvo5 merged commit 060aa18 into mvo5:master Oct 15, 2018
@Skif-off
Copy link

@soc

moved buttons which operate on the package listing to the right ("properties", "search")

Why? It's not very convenient: all control is concentrated on the left side: main menu, toolbar and filters buttons (checkboxes too :)).
Is this due to this change if the "show package properties in main window" setting is enabled, the "properties" button is hidden, reducing the amount of different ways package properties are be displayed ? Maybe just swap: "update", "upgrade", "apply", "search", "properties"?

@soc
Copy link
Contributor Author

soc commented Dec 26, 2019

@Skif-off I tried many different combinations, and most looked really "unbalanced", especially when this additional input field that filters the listing also gets added to the toolbar.

(As far as I remember, the filter is centered, so when you put everything on the left of it, it starts looking horribly except when you make the window very wide.)

So there is some precedent of having the search on the right side, and I went with this, because it was the least bad option of the ones I tried.

I think it would be really nice to have either the filter input, or the search dialog, but I think I cannot decide this (and I also lack good ideas how the UI should work conceptually after such a change change).

@Skif-off
Copy link

Skif-off commented Jan 8, 2020

Sorry, I forgot and did not use this email box some time.

especially when this additional input field that filters the listing also gets added to the toolbar.

How did you add quick filter to the toolbar? I did not see it long time ago, I tried and as I understood this filter was dropped. New quick filter shows and works when just press buttons on keyboard and now it's small input box below list of packages, not on toolbar (Xubuntu 18.04, Debian 9).
I thought filter was gone and it would not hindrance :)

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.

4 participants