vlastavesely / raleigh-reloaded

Raleigh Reloaded is a conservative GTK-3.20 theme aiming to revive the Raleigh theme, the default theme of GTK-2.0.
GNU General Public License v2.0
59 stars 9 forks source link

Please document theme compatibility with Eclipse #14

Closed unix-junkie closed 2 years ago

unix-junkie commented 3 years ago

Modern versions of Eclipse IDE, when used with Raleigh-Reloaded theme, need some extra tricks in order to look like Eclipse 4.7 (the last version to support GTK2). It took me a while to figure those out, so it makes sense to make this information more widely available.

Here's how Eclipse main toolbar looks like (GTK2):

5-eclipse-4 7-gtk2-raleigh-toolbar

The same toolbar with a button hovered (GTK2):

6-eclipse-4 7-gtk2-raleigh-toolbar-hovered-button

A toolbar of a tool window (GTK2):

7-eclipse-4 7-gtk2-raleigh-tool-window-toolbar

It can be clearly seen that toolbars per se are flat (have no borders), and toolbar buttons (CSS: toolbar > button.flat) only have borders when pressed or hovered. Here's how the Preferences dialog looks like:

0-eclipse-4 7-gtk2-raleigh-preferences

Things get slightly different when a more recent Eclipse version (4.8+, the current version is 4.20) is run. Here's the same Preferences dialog with GTK3 and Raleigh-Reloaded theme. As you can see, toolbars now have a border of their own, as also do some other components:

0-eclipse-4 20-gtk3-raleigh-reloaded-preferences

This can be worked around by setting the following styles:

toolbar {
        border: 0;
}

toolbar button.flat:hover {
        background-color: #eeebe7;
}

toolbar button.flat:active,
toolbar button.flat:checked {
        background-color: #c4c2bd;
}

scrolledwindow {
        border: 0;
}

frame {
        border: 0;
}

Unfortunately, the above selectors are way too generic and will most probably negatively impact other applications, that's why I'm not yet requesting that the above CSS is added to other-applications.css (see bug #576043). So the only solution, for now, is that the above CSS fragment is placed into a separate file that is referenced from the eclipse.ini file:

-startup
plugins/org.eclipse.equinox.launcher_1.6.200.v20210416-2027.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.2.200.v20210429-1609
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=11
-Dosgi.dataAreaRequiresExplicitInit=true
-Dorg.eclipse.swt.graphics.Resource.reportNonDisposed=true
-Dorg.eclipse.swt.internal.gtk.noThemingFixes
-Dorg.eclipse.swt.internal.gtk.cssFile=/opt/eclipse/eclipse.css
-Xms40m
-Xmx512m
--add-modules=ALL-SYSTEM

Note these two Java system properties:

vlastavesely commented 3 years ago

Hello, thank you for the effort. In the recent past, I have made some changes concerning the GTK viewports and some minor fixes. It is not pushed yet but I would like to release it as soon as possible. It may be that it solves at least some problems.

Also, I was trying to make a stylesheet for Firefox, namely for the new Proton UI. At this point, I am still not sure whether the additional CSS for FF (once finished...) shall be a part of this repository or not since there is exactly the same problem as with Eclipse: it can be done only as an external CSS file and cannot be a part of the theme as such. At least, it could be a solution to create a directory called ‘3rdparty’ or ‘docs’, where CSS for non-gtk applications would be documented.

Once the final decision regarding the FF CSS is made, I will do something with this issue.

vlastavesely commented 3 years ago

Today, I have released the changes I mentioned.

Now, I need to finalise the styles for Firefox (at this point it is in the proof-of-concept phase).

unix-junkie commented 3 years ago

@vlastavesely, thank you for your feedback.

I've tested the theme with your latest commit (1106b43), but Eclipse-specific selectors are still necessary (as I said, Eclipse-specific styles may only be application-specific, not theme-wide, because the hierarchy of Eclipse CSS classes -- or, rather, the absence of one -- doesn't allow CSS selectors to be specific).

vlastavesely commented 2 years ago

I have finally managed to come up with a solution. As I do not use Eclipse, I cannot guarantee that the script would be 100% up-to-date all the time. Therefore I have added it as a documentation text file. The promised CSS for Firefox will very likely be in a separate repository and documented in the same way.