geany / geany-osx

Things needed to bundle Geany for OSX
Other
24 stars 14 forks source link

Vertical Scrollbar nearly invisible after update to Geany 2.0 #55

Closed rovf closed 8 months ago

rovf commented 9 months ago

MacOS Monterey, running Geany 2.0

After updating from Geany 1.38 to Geany 2.0, the vertical scrollbar became so narrow, that I find it nearly impossible to grab it with the mouse. In 1.38, its width was pretty much the same than other Apple application (scrollbar width seems to be kind of an Apple GUI standard).

This screenshot shows how the scrollbar looks like in the new version:

Screenshot 2024-02-26 at 03 27 55 PM

I don't have Geany 1.38 installed anymore, but here is for comparision another text editor, showing a scrollbar with a "typical" width:

Screenshot 2024-02-26 at 03 30 01 PM

If Geany decides to draw its scrollbar manually, I suggest that you offer in the preferences the possibility to define the scrollbar width.

elextr commented 9 months ago

The scrollbar is a standard GTK widget so you can probably twiddle it with GTK CSS in geany.css (menu->tools->configuration files->geany.css). Maybe the default Macos theme changed between 1.38 and 2.0.

rovf commented 9 months ago

I don't see in geany.css any CSS command which would correspond to the scrollbar.....

rovf commented 9 months ago

I found that rebooting my Mac improved the situation. The screenshot I appended to this issue was taken after I installed geany 2.0. Last night I shut down the Mac, and today the scrollbar is wider than before. I would still love to have even wider, but at least it is usable as it is right now.

elextr commented 9 months ago

The setting would be in the theme, but in the manner of web css later settings override earlier ones and geany.css is the last loaded. So geany.css will only contain settings that need to be changed and will override everything, but nobody has changed the scrollbars. You need to add whatever you want to set. Sorry detailed settings and advice on GTK CSS are beyond Geany support. So you would need to look at the docs linked above and/or enquire on GTK related forums.

rovf commented 9 months ago

Perhaps due to an limitation of MacOS, styling the scrollbar in GTK is not possible. For instance, setting scrollbar-width does not have any effect, and I found this discussion, which confirms that it is not possible to set the scrollbar width on MacOS. The "solution" suggested is to change the screen resolution in a way, that everything (and hence also the scrollbars) appear bigger.

elextr commented 9 months ago

Just be aware that GTK is not native to Macos, it often does stuff its own way ignoring Macos.

techee commented 8 months ago

Just have a look at the theme file at

/Applications/Geany.app/Contents/Resources/share/themes/Prof-Gnome/gtk-3.0/main-light.css

(assuming you are using the light theme, the dark one would be configured in main-dark.css)

Scrollbar styling starts at line 3235. I just tried to modify

scrollbar slider { 
         min-width: 6px;
        min-height: 6px;
            margin: -1px; 
            border: 3px solid transparent; 
     border-radius: 8px;
   background-clip: padding-box; 
  background-color: #9ca0a1;
}

and increased min-width and min-height and it seems to work (Geany restart is needed for this). You can also just put something like

scrollbar slider { 
         min-width: 10px;
        min-height: 10px;
}

into geany.css to avoid having to modify the theme directly.

rovf commented 8 months ago

Thank you very much for your attempts to help. I put the code you suggested into geany.css (using a min-width of 22px), since I want to have the wide scrollbar independent of the theme, and after restarting got indeed a think scrollbar, which was convenient to use. However, after terminating Geany and starting it a second time, I had the old, thin scrollbar back, although I could verify, that geany.css does have the changes. It's a mystery to me....

UPDATE: I am just wondering, whether perhaps the setting in /Applications/.../Prof-Gnome/gtk-3.0/main-light.css, which is still at 6px, somehow overrides the value in my geany.css. However, I don't want to change anything below /Applications/Geany.app . Is it possible to somehow copy the file main-light.css to some place below my ~/.config/geany and change it there? If yo, which subdirectory of .config/geany should it go to?

techee commented 8 months ago

Are you sure you don't have some syntax error in geany.css that would possibly prevent its loading? I'd suggest that you make a backup of this file somewhere and then place just

scrollbar slider { 
         min-width: 20px;
}

in it and restart geany. If it works, you'd have to figure out what is wrong in your original geany.css.

rovf commented 8 months ago

Right you are. There was a syntax error, which was hard to spot: A spare / character had been inserted somewhere in the edit buffer. I guess I accidentally hit this key when editing, without noticing. Works now!

techee commented 8 months ago

Great, good to hear!

I'm closing this issue as I believe the scrollbars are reasonably sized by default and overriding their size works too.