Beep6581 / RawTherapee

A powerful cross-platform raw photo processing program
https://rawtherapee.com
GNU General Public License v3.0
2.8k stars 316 forks source link

Porting RT to Gtk3 #2807

Closed Beep6581 closed 9 years ago

Beep6581 commented 9 years ago

Originally reported on Google Code with ID 2827

I'm opening a thread for the Gtk3 port, that I've already started for 1 month already.
I'll open a new branch soon to handle the changes once it is a bite usable. It actually
build fine, but some key deprecated feature are still there (and may remain there for
some time even for the release version), notably gdk_thread_enter/leave, which will
be hard to replace ! It's so sad that they've removed that.

In this image http://natureh.free.fr/RawTherapee/GTK3-Snapshot01.png you can see RT
with Gtk3 default skin (I hasn't done any theme file yet), and you can see that there
a lot of wasted space.

DrSlony, do you have an idea of usable theme for RT ? Do we keep this one but correctly
tuned ?

Reported by natureh.510 on 2015-07-05 19:38:41

Beep6581 commented 9 years ago
Did you use msys2 to install gtkmm3?

Reported by sguyader on 2015-07-05 21:01:31

Beep6581 commented 9 years ago
Yes, and for the whole toolchain (gccn cmake, etc...).

Reported by natureh.510 on 2015-07-05 23:24:19

Beep6581 commented 9 years ago
Hombre I have some Gtk3 themes, they're neutral-colored and good for photography. It
will be interesting to test them on RT. I like the current Gtk+ 2 themes RT has (21
and 25 gray), so tuning them would be nice too.

You can try asking the Gtk+ guys on #gimp or #gtk+ on irc.gimp.org about handling the
things that appear to be missing like gdk_thread_*

Reported by entertheyoni on 2015-07-06 21:43:55

Beep6581 commented 9 years ago
I'm getting Msys2 and the toolchain installed. Hombre when you open the gtk3 branch,
please let me know. Thanks for your work!

Reported by sguyader on 2015-07-07 13:50:07

Beep6581 commented 9 years ago
Great news!

A question regarding Linux / Gnome:
Could you consider requesting the dark theme variant through "gtk-application-prefer-dark-theme"?
This would automatically enable dark widgets and window decorations (if available for
the current theme).

Reported by alex.c.hofbauer on 2015-07-18 17:41:09

Beep6581 commented 9 years ago
I'm at the stage of porting the actual theme to Gtk3, but it's a total mess! Of course,
we want a light and dark theme (well, mostly dark :) ), and would like to enable the
default dark theme but didn't knew how to do that.

As I'm not fluent with Gtk3, could you give me more information on how to use gtk-application-prefer-dark-theme
please ? I know how to load css files, but not how to use the .ini files and the index.theme
file (not sure it is used at all on Windows).

Reported by natureh.510 on 2015-07-18 18:48:09

Beep6581 commented 9 years ago
Re #7: I found out myself.

Reported by natureh.510 on 2015-07-19 22:42:05

Beep6581 commented 9 years ago
I'm not particularly fluent in GTK either (mostly copy/paste and stackoverflow-coding
in that regard) but what I've done in the past was something like:

GtkSettings *gtk_settings = gtk_settings_get_default();
g_object_set(G_OBJECT(gtk_settings), "gtk-application-prefer-dark-theme", TRUE, NULL);

This enables the dark Adwaita theme. I don't know what would happen if you're using
your own theme, but at least the window decorations should be dark, I think. I don't
know how themeing works on Windows though.

If you need someone to test, I've been using Linux exclusively for years now and know
how to compile code. ;)

Reported by alex.c.hofbauer on 2015-07-19 22:42:44

Beep6581 commented 9 years ago
Thanks for the offer :). Just star this issue to be notified of new comments, I'll open
the new branch as soon as I'll have solved the known bugs. The patch is 437 kb now.
I think that for the first try, we'll not support support various theme, but only one
dark theme (based on the default Gtk one).

And my solution was:
Gtk::Settings::get_for_screen( Gdk::Screen::get_default() )->set_property("gtk-application-prefer-dark-theme",
true);

Reported by natureh.510 on 2015-07-19 22:51:27

Beep6581 commented 9 years ago
Small report to say that it's coming along nicely, 95% done before first commit to its
own branch, and say 85% before a complete transition to Gtk3.

I think that we may stick to only one theme (the default dark one, but quite nice!)
for a moment.

Reported by natureh.510 on 2015-07-26 21:47:18

Beep6581 commented 9 years ago
Great news!
Could you share the patch with me in IRC before branching?

Reported by entertheyoni on 2015-07-27 18:41:59

Beep6581 commented 9 years ago
Reminder of bugs to fix:
- checking the "Hide the vertical scrollbar" bring an off behavior, maximizing the
vertical size of the Window because there's no more scrollbars
- set_request_size doesn't seem to work on combobox, the minimal width of the widget
is the maximal width of the entries!
- set big buttons in the IPTC panel

Reported by natureh.510 on 2015-07-27 22:00:58

Beep6581 commented 9 years ago
- Set the font used in the About/Release Notes window to a monospace one.
- Frames in the Queue tab don't flow and stretch correctly http://i.imgur.com/pZj17w0.png
- Thumbnail overlay icons don't show http://i.imgur.com/3qKJKa3.png (empty square in
the top-left corner).
- Hide the column headers in the History panel.
- Maybe remove padding from sliders as together with the label and +/- buttons they
take up a lot of space http://i.imgur.com/3wCPAuu.png But I love the big, easy to grab
handles!
- The font size is currently hard-coded in the theme instead of using the one from
Preferences, which results in tiny characters when my system uses a high DPI value
(as you can see in the screenshots).
- Both progress bars (the main one, and the Editor tab one) need to be fed more to
become nice and fat again http://i.imgur.com/bpJ4nE3.png
- Buttons with icons used to have the label next to the icon in Gtk2 RT, but the Gtk3
RT just has icons which makes it harder for new users to find certain features, e.g.
look at the Auto Distortion Correction button - Gtk2: http://i.imgur.com/CiH7yg9.png
Gtk3: http://i.imgur.com/bwHxTyk.png

Reported by entertheyoni on 2015-07-28 09:34:05

Beep6581 commented 9 years ago
About the progress bar, that's one of the thing that are difficult to do (or at least
way less obvious) than in Gtk2.

About the buttons without text labels, the new Gtk3 guideline prevent using both in
the same button. Ask them why!? I can revert to the dual image+text icon, but it's
will need more coding. For buttons without tooltip, I've set the tooltip to the older
text label, so users will still have an idea of what the buttons are used for.

About the font size, I is working here, but I'll investigate.

About the column header in the History list, they are already there in the actual version
(IIRC), so it will be fixed in a separate issue.

Reported by natureh.510 on 2015-07-28 11:53:02

Beep6581 commented 9 years ago
How much more coding for icon+text are we talking about? If we must choose just one,
its better to have text as its more informative, easier to find (for new users), and
those buttons are as wide as the panel.

Seems I can't change any property of the font - not the font itself, nor the size,
nor weight, etc.

You're right about the column headers. I now remember I tried hiding them because they
contain no useful text, but the problem with that was when I hid them then you could
no longer resize the column widths. Not a problem to leave them.

Reported by entertheyoni on 2015-07-28 12:20:29

Beep6581 commented 9 years ago
The amount of time is not that important, I just should have asked before switching
to what Gtk recommend.

Reported by natureh.510 on 2015-07-28 18:11:50

Beep6581 commented 9 years ago
Here is a first patch. I wanted to commit it to a new "Gtk3" branch, but it seems that
I don't have the permission to do that. Could someone do that for me please? Beware:
there is 2 css file to add and 2 files to remove (rtgui/rawprocess.cc & .h)

This patch require Gtk 3.16 (yes, I know, it's still not "stable", but I don't have
any lower version through MSYS...)

Known problem to be solved:

1. GtkDialog needs a transient...  I may need help on this.

2. Slim interface is not yet supported. The option is there, you can check it but it
will be ugly! If you want to see a nice RT, stick to the non-Slim interface for now
(RT needs to be restarted to take fully effect).

3. Actually, only the default Dark theme from Gtk is used. The theme selector is unused
in the current version. I'd like to know if we have to support multiple variant of
the dark theme (I don't think that Light themes are used at all, nor 
useful). In this case, I'll need some time to investigate what are the default Gtk
css files. Maybe a Linux user will have to send it to me, if you can find them in your
Gtk install.

4. gtk_thread_enter/leave : this is deprecated but still available, for now. We have
to replace this some day, before it is completely removed!

5. In the Queue tab, the visibility of the Format frame on first use have to be correctly
set (some hidden elements are still there).

6. Nicer knobs (cached) for the threshold selector and Param's curve SHC seletor.

7. have to optimize the curves background color and size. Low priority!

8. Get back the Icon+Text buttons. I personally find the icon only option lighter.
There is tooltip explaining their purpose, so users are not that lost. I'd like to
have a vote on "do we have to bring back Icon+Text" buttons?

The spin buttons now have big +/- buttons. On #Gtk, they told me that I have to create
my own spin button if I want the old, compact style. This is not planed.

Linux version has already been tested (roughly) but Mac version has not yet been tested.

The "Use system theme" has not yet been tested. I'd like to hear about this for Linux
and Mac.

On all platform, it would be nice if you could test with a pen tablet (Wacom) to look
out if issue 438 is solved.

...and last but not least, maybe someone could think about a RawTherapee 5.0 splash
screen ;)

Reported by natureh.510 on 2015-08-03 09:11:58


Beep6581 commented 9 years ago
I will commit it tonight Hombre.

Reported by entertheyoni on 2015-08-03 10:34:33

Beep6581 commented 9 years ago
Hi Hombre, do you know if there is a way to try this patch without compromising my ability
to compile RT as is, so I can continue providing Winx64 builds? I recall you mentioned
that installing GTK3 prevented you from using GTK2.

Reported by michaelezra000 on 2015-08-04 03:19:39

Beep6581 commented 9 years ago
I think it's possible to have 2 toolchain installed, but we'll have to play with environment
variables. I may put that in practice on my own PC first to be able to build the Gtk2
version.

For the moment, if you want to test the Gtk3 version, I've uploaded some files that
might help you:

1.  http://www.rawtherapee.com/shared/builds/windows/dependencies_for_creating_builds/rtlibs-gtk3.7z

This is the dependencies to add to a Windows7/8 64 bits version, above what the build
process produce.

2.  http://www.rawtherapee.com/shared/unofficialbuilds/windows/RawTherapee-4.2.270-64bits.7z

This is a Release build of the patch from comment 19. You'll need to add the dependencies
from #1 to start RT.

If you're interested, I can upload the complete toolchain to build RT on Windows 7/8
64 bits (archive size: 340 Mb!). I think it can work to unzip the archive, set 3 environment
variables, and go ahead...  well, I hope so.

Reported by natureh.510 on 2015-08-04 23:53:54

Beep6581 commented 9 years ago
On Linux I have both Gtk+ 2 and 3 libs concurrently.

Reported by entertheyoni on 2015-08-05 08:51:45

Beep6581 commented 9 years ago
I don't manage to compile a gtk3 version, I get complaints like 'cannot mix gtk2 and
gtk3 commands' on Xubuntu 15.04. Also libs missing: gtk+-3.0 >=3.16, glibmm-2.4 and
giomm-2.4. Synaptic shows nothing when typing giomm, so possibly part of another package.

For the moment I keep the gtk2 version, also to keep the interface consistent with
the screen dumps for my wavelet articles. 

Reported by paul.matthijsse4 on 2015-08-05 09:36:11

Beep6581 commented 9 years ago
Ubuntu 15.04 doesn't have Gtk+ 3.16 in its package manager yet.
http://distrowatch.com/table.php?distribution=ubuntu

Reported by entertheyoni on 2015-08-05 09:44:10

Beep6581 commented 9 years ago
Fedora should be a good choice. They are always very close to Gnome releases and 22
features 3.16

I'd normally don't recommend using Debian/unstable (unless you really absolutely know
what you're doing), but it features 3.16.6 and 2.24.28 which can be installed and used
in parallel.

I'm in no way anti-Ubuntu (I actually think it's a nice distribution) but from a Gnome/GTK
developer's point of view I think it's not first choice.

Reported by alex.c.hofbauer on 2015-08-05 09:49:09

Beep6581 commented 9 years ago
DrSlony, thanks for the info.

Alex, thanks for suggesting Fedora. I have used Core 4-6, then switched to Ubuntu for
some (good) reason. This gtk3 thing isn't too important for me, so I'll wait until
it arrives in Xubuntu. 

Regards, Paul. 

Reported by paul.matthijsse4 on 2015-08-05 10:00:29

Beep6581 commented 9 years ago

The Gtk3 branch is ready. Let's address individual issues in individual comments, to get rid of these imported GC issues.