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

Overlapping scrollbar with close button in "Markdown Cheatsheet" #111

Closed
heldderarbeit opened this issue May 5, 2024 · 4 comments · Fixed by #114
Closed

Overlapping scrollbar with close button in "Markdown Cheatsheet" #111

heldderarbeit opened this issue May 5, 2024 · 4 comments · Fixed by #114
Labels
enhancement New feature or request

Comments

@heldderarbeit
Copy link
Contributor

If you hover over the scrollbar it is rendered on top of the X button, there should be some space between them.

Untitled

Installed version is 24.10 from Flathub

@toolstack
Copy link
Owner

That's a function of gnome that I don't think I can change, I guess I could add a buffer to the top of the window so that the cheat sheet appeared below the close button, but that seems like a waste of space.

@toolstack toolstack added the wontfix This will not be worked on label May 5, 2024
@toolstack toolstack added this to the Probably Never milestone May 5, 2024
@toolstack
Copy link
Owner

Closing as wontfix.

@heldderarbeit
Copy link
Contributor Author

If you are open to suggestions regarding this - How about a regular headerbar? Here's how it would look like before / after.

image

Or another comparison with a different version, maybe moving up the first header to save space:

image

In that case the "Headings" line would be roughly on the same position.

Implementation-wise I found out that it's relatively easy: nesting the GtkMarkdownView in an Adw.StatusPage and replacing Adw.Window with Gtk.Window is enough.

using Gtk 4.0;
using Adw 1;

template $FolioMarkdownCheatsheet : Gtk.Window {

  default-width: 500;
  default-height: 440;
  titlebar: Adw.HeaderBar {};

  ShortcutController {
  …
  }

  Adw.StatusPage {
      css-name: _("status_page");

      $GtkMarkdownView text_view {

      tab-width: 4;
      …
      }
  }

}

That would bring 3 advantages:

  1. Scrollbar won't overlap anymore with close button
  2. it's not possible anymore to resize the window like this (resizing is completely blocked like in the keyboard shortcuts window):
    image
Screencast.from.2024-05-07.20-35-10.webm
  1. less code compared to now, for example ScrolledWindow is not needed anymore since scrolling is done automatically by Adw's StatusPage

If there is interest I could send a merge request for one of the headerbar versions (but really, there's not more code than I have listed here).

I would be very glad to see this realized since I very much like the general aesthetics of the app (it feels like it almost could belong to GNOME Circle and I would encourage you to apply your app for submission) but feel they are tarnished by the behaviour I described here. Therefore I stepped in to give some additional information and possible resolutions, despite having no prior experience with GTK elements beforehand.

It's a small change, but in my opinion would result in a much more professional look.

@toolstack
Copy link
Owner

I'd accept a PR for this, I'd title the status page "Markdown Cheetsheet" and remove the "Markdown Syntax" in the md file.

@toolstack toolstack reopened this May 7, 2024
@toolstack toolstack added enhancement New feature or request and removed wontfix This will not be worked on labels May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants