Port to GTK 3#37
Open
bgermann wants to merge 6 commits into
Open
Conversation
There is no migration code; users will lose all their configuration. I don't know why GConf was not used on Windows and macOS; I guess it's because it is a different library. Someone (upstream) with access to these systems should verify if GSettings work there (it's part of GLib so it should in theory) -- if that's the case it would simplify the code a lot as much of amide_gconf.c will be removed along with the *_with_default functions. Addresses: ferdymercury#27
Unfortunately, the move to GTK 3 makes the main (study) window wider even without an image loaded (#901677). This is because some of the widgets are larger, like GtkSpinButton with big "+" and "-" in it. Additionally, GTK computes the width of the widget based on the min/max values of the adjustment -- so the "thickness" button gets wider than usual because the maximum allowed value is G_MAXDOUBLE. A major hurdle was frequent aborts when using the custom log handler due to a GLib bug (see src/amide.h). The only solution I came up with was to redefine the macros and avoid setting a custom handler. The GtkCurve and GtkGammaCurve widgets were ported to GTK 3 but stripped from some functionality that AMIDE doesn't need (functions like gtk_curve_set_vector are not available, also the additional buttons of the GtkGammaCurve widget). As is required by GTK 3, drawing is done to an off-screen buffer (a cairo surface) which is then effectively drawn on the widget during the ::draw signal. The GtkHandleBox widget was not ported so parts of the UI are no longer detachable. I didn't consider this functionality important enough to bother (unlike GtkCurve/GtkGammaCurve). The AmitkDial widget was modified to behave as with policy GTK_UPDATE_DISCONTINUOUS, which is the only use within AMIDE. Since GTK 3 removed policy support in GtkRange-based widgets, all of the widgets where GTK_UPDATE_DISCONTINUOUS is set (for a good reason) were modified to connect to a "button-release-event" handler, as a workaround. The "value-changed" callback is invoked from there. Fixes: ferdymercury#27
Owner
|
Thanks for this huge effort! I guess we need someone with Windows to test these changes, before proceeding. |
Collaborator
|
This is great, and would simplify my port to meson |
Toolbar menu items "Thickness", "Field of view" and "Zoom" do nothing but they are necessary -- if the window is resized so that the right border is at one of these widgets, no drop-down arrow will be shown so the user will not have access to the Gate/Time buttons. Other items from "Threshold" leftwards are proper GtkToolItems (rather than widgets packed in a GtkToolItem) so their menus are fully functional and will appear as normal/toggle/radio menu items. Fixes ferdymercury#26.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a submission from Debian to port to GTK 3. The original patch used GooCanvas but is now available with its own Canvas abstraction in Debian unstable.
Fixes: #27
Fixes: #24