Difference between revisions of "GTK+ 3 issues"

From Inkscape Wiki
Jump to navigation Jump to search
Line 44: Line 44:
 
* Load all theme information from an external CSS style sheet.  This will potentially tidy our code by removing hard-coded styling instructions, and will make it possible to properly apply user themes to Inkscape.
 
* Load all theme information from an external CSS style sheet.  This will potentially tidy our code by removing hard-coded styling instructions, and will make it possible to properly apply user themes to Inkscape.
 
* Switch to using a GtkIconTheme, with all custom icons installed in a standard way instead of bundled within a single SVG document.  This will make it easier to provide user icon themes, and get rid of a lot of deprecated code.
 
* Switch to using a GtkIconTheme, with all custom icons installed in a standard way instead of bundled within a single SVG document.  This will make it easier to provide user icon themes, and get rid of a lot of deprecated code.
 +
** We should also unify all the code for creating buttons with icons.
 
* Switch to using GtkApplication instead of GtkMain.
 
* Switch to using GtkApplication instead of GtkMain.
 
* Switch to using GAction instead of GtkAction <- this one might be deferred indefinitely; see Gimp's direction for comparison (Gimp has stated they will not switch).
 
* Switch to using GAction instead of GtkAction <- this one might be deferred indefinitely; see Gimp's direction for comparison (Gimp has stated they will not switch).

Revision as of 09:09, 4 May 2016

This page is for Gtk documentation, any issues, questions or notes about the porting of inkscape to Gtk3. This document will be sent to the gtk/gnome developers and may be useful for Gimp developers who undergo the same process.

Issues

Document your issues with porting Inkscape to Gtk3 below.

  • Jumping palette. The color bar/palette does not seem to be able to decide how high it should be, at least for some combinations of palette width, height, etc. See launchpad bug #1201545.
  • Icons are too small / cut. (if someone can find the launchpad bug for this one, please add link here). This is probably caused by the use of SPIcon instead of a standard GtkImage widget.
    • The clipping of icons in the toolbar is fixed in r14870. Problem had to do with custom button widget which wraps icon. The preferred/minimum width/height was not taking into account the padding around the icon.
    • We have too many ways of creating buttons with icons which leads to inconsistency of behavior.
  • All custom widgets now use the Cairo drawing model. All need to be fully tested, and several (e.g., the filter editor) are not rendered correctly.
  • Several of the Gtk+ widgets have changed their layout (in particular, the GtkSpinButton is now much wider). Many of the toolbars now overflow the screen horizontally, and many dialogs are now far too wide. The layout of affected containers should be redesigned to account for this.
  • The rules for sizing of widgets within containers has changed in Gtk+ 3. In many cases, widgets will initially appear far too big, or with zero size. All dialogs and containers need to be checked for these issues.

Standard Practice

List any repetative actions during the upgrade and note anything that needed doing when moving from gtk2 to gtk3 widgets (for examine hbox and vbox) be clear if the action is using gtk3 or gtkmm (which often papers over some of the move to gtk3)

* GtkHBox and GtkVBox are now just GtkBox with an orientation attribute.

Widgets

List any and all custom widgets currently being used in Inkscape.

  • Rulers - src/widgets/ruler.cpp
    • Should probably be updated from GIMP.
  • SPIcon - src/widgets/icon.cpp
    • Should be replaced with regular GtkImage.
    • SPIcon does much more than just rendering the icon. I (Tav) don't think it can be replaced by GtkImage.
  • SPCanvas - src/display/sp-canvas.cpp
    • Needs to stay a custom widget. Fixed for GTK3.

Ideas

Any ideas which are interesting

* No ideas yet

Deferred changes

Work items, which should be carried out after the release of Inkscape 0.93. These are tasks, which would be impractical to perform until after we have permanently ended our support for Gtk+ 2. For example, these may make use of new Gtk+ 3 features, which have no simple fallback available in Gtk+ 2.

  • Delete all Gtk+ 2 backward-compatibility code. This will remove over 700 blocks of conditional build instructions from our code base, and thousands of lines of redundant code. This is essential for future maintainability, and will greatly simplify future work on Gtk+ 3 features.
  • Load all theme information from an external CSS style sheet. This will potentially tidy our code by removing hard-coded styling instructions, and will make it possible to properly apply user themes to Inkscape.
  • Switch to using a GtkIconTheme, with all custom icons installed in a standard way instead of bundled within a single SVG document. This will make it easier to provide user icon themes, and get rid of a lot of deprecated code.
    • We should also unify all the code for creating buttons with icons.
  • Switch to using GtkApplication instead of GtkMain.
  • Switch to using GAction instead of GtkAction <- this one might be deferred indefinitely; see Gimp's direction for comparison (Gimp has stated they will not switch).