Commit Graph

155 Commits

Author SHA1 Message Date
Jehan 636b77f7d3 app: fix a "Floating point exception" crash.
`icon_space_width` is set when GtkWidget::style-updated signal is
emitted. In some cases, it was possible that gimp_statusbar_set_text()
is run before this happens, in which case, a division by zero would
crash the software.

I encountered this case in some rare occasions when duplicating an image
with ctrl-d, then as Ctrl was hold, the message "Click in any image to
pick the foreground color" was pushed on the brand new statusbar as it
is created (hence a race condition occurs with the signal handler and
this message). This was therefore not reproducible every time, but easy
enough to reproduce with multiple tests.
2019-02-13 21:06:08 +01:00
Jehan 1d984542e9 Issue #2828: Scrolling up with a mouse within a drop-down list.
We were doing it all the wrong way, fixing one combo box object at a
time. So this commit basically reverses commits 68a33ab5bd, 6dfca83c2a
and a9a979b2d0 and instead runs the same code in the class code. This
way, all objects based on these base classes will have the fix from
scratch.
These improved various other drop-down lists (I found some of them, and
probably not all) as I fixed all GIMP custom widgets based on
GtkComboBox.

Note that it has to be run after filling the list apparently (I had the
problem especially with GimpIntComboBox if running in the _init() code,
then the list widget showed wrong).
2019-01-20 13:08:36 +01:00
Michael Natterer 291e84281a app: fix canvas jumping because of the status bar label being too wide
Set the label to ELLIPSIZE_END and add some packing options, and
switch from using pango attributes to simply prepending the right
number of spaces to leave enough room for the icon. The attributes
were somehow breaking ellipsation.
2019-01-02 17:49:53 +01:00
Michael Natterer e3e2cdcbd2 app: make GimpFgBgEditor and GimpStatusbar HiDPI-aware
so their icons look proper again on HiDPI monitors.
2018-12-31 19:12:00 +01:00
Jehan 182786b4fb app: fix type warning.
I missed this warning when reviewing commit a9a979b2d0.
My bad!
2018-12-19 16:01:06 +01:00
Kevin Stoffler a9a979b2d0 app: add gtk_combo_box_set_wrap_width for scale menu 2018-12-18 16:03:33 +00:00
Jehan 1e5cf10585 icons, app, libgimpwidgets: use Freedesktop standard icons.
Some icons were still using old gimp-namespaced names.
2018-07-28 12:27:10 +02:00
Michael Natterer 5f700549e7 Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:29:46 +02:00
Michael Natterer 716412a807 app: undeprecate GimpStatusbar
The call to gtk_container_resize_children() was probably completely
useless in GTK+ 3.x anyway.
2018-07-03 23:25:24 +02:00
Michael Natterer 3089a20167 app: remove all calls to gdk_window_process_updated()
- remove gimp_widget_flush_expose()
- remove the "now" argument to gimp_display_shell_flush() and make it
  only update widget states
- rename gimp_display_flush_whenever() to gimp_display_flush_update_region()
  and call gimp_display_shell_flush() separately in the only case we
  passed FALSE to flush_whenever()
- remove th flush_now interval logic from GimpDisplay, as soon as we
  have exposed the canvas, we are in the loop for the next frame clock
  tick anyway, so delaying a useless and removed process_updates serves
  no purpose
- in gimptool-progress.c, create the invisible grab widget also for
  non-cencelable cases, so we can always safely run the main loop
  manually to make the progress updates visible
- in gimp-gegl-apply-operation.c, always run the main loop manually
  to make the progress updates visible
- in gimpstatusbar.c, leave some FIXME comments as reminder that
  we might need the same logic as in gimptool-progress.c
2018-07-01 16:40:27 +02:00
Michael Natterer 1806b66c5a Issue #1560 - invisible canvas flip/rotation buttons...
...at the bottom of image window

Need to show/hide the event box, not just the labels/icons inside.
2018-06-04 15:13:23 +02:00
Michael Natterer e76c1305a5 app: derive GimpStatusbar from GtkFrame not GtkStatusbar
we were not using a single GtkStatusBar features, it was only in the
way. Remove broken size allocation logic and simply set a minimum
height of 3em in CSS. Also ellipsize the label, long labels had funny
effects since changing the overall GimpDisplayShell packing to pure
GtkGrid.
2018-05-20 21:06:35 +02:00
Michael Natterer 1fdc472c68 app: make the statusbar's progress label visible again
and remove setting of removed align properties. The label alignment is
broken now until that feature comes back to gtk+.
2018-05-20 21:06:29 +02:00
Michael Natterer 8c975484ab app: check whether child widgets exist in GtkWidget::style_updated()
because it is emitted repeatedly during widget construction, when not
everything is in place yet.
2018-05-20 21:06:28 +02:00
Michael Natterer e713ad4a43 app: implement GtkWidget::style_updated() instead of style_set() 2018-05-20 21:06:28 +02:00
Michael Natterer 64cde17687 app: don't connect to "size-requst" because that's deprecated
Instead, connect to "style-set" and calculate the widget's size
request there. Also fix the label's offsets after whatever GTK+ text
drawing changes.
2018-05-20 21:06:27 +02:00
Michael Natterer 86e033d495 app: port to GtkWidget::draw() 2018-05-20 21:06:26 +02:00
Michael Natterer df65b0bdcd app: use gtk_widget_get_preferred_size() instead of size_request() 2018-05-20 21:06:26 +02:00
Ell bea27171ad app: throttle statusbar progress updates
Statusbar progress updates that update the progress bar are
relatively expensive, slowing down operations that report progress
frequently.  Only update the progress bar if a certain amount of
time has passed since the last update, to counter that.
2018-04-07 12:05:59 -04:00
N Ferreira 3f7afd5494 Bug 792439 - Status bar: Rotated angle is too close to zoom arrow. 2018-01-12 01:50:51 +01:00
Jehan 80b04d06da Bug 789173 - Make canvas rotation information visible on the main window
Now add also flip information in the status bar so that one knows that
the canvas is flipped horizontally and/or vertically. Especially if you
often flip and rotate the canvas (or if you did it by mistake), at some
point, it may become confusing to remember whether this is the case. Now
it will be possible to check in a single glimpse at the status bar.
Similarly to what I previously did for the rotation information, hitting
the flip icons in status will allow to unflip easily without having to
go in menus or remember all shortcuts.
These information will be visible only when the canvas is flipped or
rotated.
2017-11-15 20:04:19 +01:00
Jehan 953a095563 Bug 789173 - Make canvas rotation information visible on the main window
The rotation angle is made visible in the status bar.
Clicking the angle label also opens the "Select Rotation Angle" dialog.
2017-11-15 20:02:54 +01:00
Ell b2bc33bdf1 app: blink the statusbar on warnings and errors
Statusbar messages are too easy to miss.  Blink the statusbar when
showing a warning or an error, to attract attention.
2017-10-28 10:08:10 -04:00
Michael Natterer 0cb3e75f79 app: use a lot of g_clear_object() and g_clear_pointer()
More than 2000 lines of code less in app/, instead of

if (instance->member)
  {
    g_object_unref/g_free/g_whatever (instance->member);
    instance->member = NULL;
  }

we now simply use

g_clear_object/pointer (&instance->member);
2017-07-15 18:42:44 +02:00
Jehan 2762662ca9 app: use gimp_unit_get_accurate_digits() in a few places. 2017-01-23 20:59:28 +01:00
Jehan f836892314 Bug 763734 - better decimal places for physical units.
Compute the ideal decimal precision for cursor position and length
status so that you get the best precision on physical units depending
on the current resolution, yet avoiding over-precision (which can be
misleading). The unit's "digits" value is now used as a minimum
precision only.
2017-01-20 00:40:27 +01:00
Michael Natterer 88ff45eb05 app: keep the statusbar progress from drawing over the right docks
In a blocking operation we don't give the main loop time to lay out
the statusbar correctly after showing the progress bar. Force a size
on the progress bar using gtk_widget_size_allocate(). This sucks.
2016-09-28 00:44:14 +02:00
Michael Natterer 4df9a1d568 Get rid of gtk_misc_set_alignment(label) and use gtk_label_set_x,yalign() 2016-09-08 19:11:20 +02:00
Jehan 6c674e973c app, libgimp*, plug-ins, icons: revert icon names into freedesktop...
... standard icon names and GTK+ icon names as second choice.
We should only use GIMP specific icon names as last resort, when there
is no standard or GTK+ names dedicated to the function.
This is made possible thanks to commit 3cc77b0.

s/gimp-document-recent/document-open-recent/
s/gimp-indent/format-indent-more/
s/gimp-next/go-next/
s/gimp-previous/go-previous/
s/gimp-save/document-save/
s/gimp-save-as/document-save-as/
s/gimp-revert/document-revert/
s/gimp-open/document-open/
s/gimp-document-recent/document-open-recent/
s/gimp-quit/window-close/ ou s/gimp-quit/application-exit/
s/gimp-warning/dialog-warning/
s/gimp-edit-clear/edit-clear/

s/gimp-justify-.*/gtk-justify-.*/
s/gimp-font/gtk-select-font/
s/gimp-color-palette/gtk-select-color/
s/gimp-cancel/gtk-cancel/
2016-09-03 15:49:29 +02:00
klausstaedtler 8b1ea3cc13 icons: Bug 759904
add
gimp-cancel
gimp-save

patch
gimpstatusbar.c
fil-pdf-save.c
gimpicons.c
gimpicons.h
2016-06-10 13:50:45 +02:00
Ell 48c2038951 Bug 765326 - Status bar progress messages aren't always updated
Keep GimpStatusbar progress messages at the front of the list.

Previously, gimp_statusbar_push() and friends would push progress
messages behind temporary messages, and would push normal messages,
added after a progress had started, in front of progress messages.
This resulted in the progress bar text not being updated if a
temporary message was active at the time the progress started, or
if a normal message was pushed after the progress started.

This commit fixes this by always keeping progress messages at the
front of the message list.
2016-05-08 22:33:08 +00:00
Ell ce8cbe6540 app: update GimpStatusbar message icon even when the text is unchanged
Probably just academic.
2016-05-08 22:32:28 +00:00
Ell bb4d04dce5 app: refactor GimpStatusbar message pushing/popping code
... to reduce duplication, and make less assumptions about the
position of messages on the list.

In preperation for some bug fixes.
2016-05-08 22:32:28 +00:00
Michael Natterer a6601d563b app: some GimpProgress cleanup
- change start() and set_text() to use "format" and "..." instead of
  "message", allowing to format progress messages in place
- s/cancelable/cancellable/
- move "cancellable" to be the second argument of start()
2014-07-12 23:45:20 +02:00
Michael Natterer bb8d65bcee Bug 730862 - Preview frozen while dragging selection tools...
...(crop, rectangle, etc) in large image zoomed-to-fit

Introduce a hash of the last 16 used icons in GimpStatusbar, it was
loading icons at a very high frequency. Found by Massimo.
2014-05-30 19:40:11 +02:00
Michael Natterer 65a65947d9 app, libgimp: replace GTK_STOCK_FOO by icon names
unless it's a stock ID used for an action button, will address that
later.
2014-05-11 22:49:22 +02:00
Michael Natterer 7d0b326359 app: add gimp_widget_load_icon() as replacement for gtk_widget_render_icon()
...and use it instead.
2014-05-08 09:11:31 +02:00
Michael Natterer 0d2d1c3752 app: port most of app's GUI from stock IDs to icon names
There is still quite some stock ID rendering around, stay tuned...
2014-05-07 15:30:38 +02:00
Michael Natterer 2eb74becb8 app: add G_GNUC_PRINTF() to places where the args are a va_list
The trick is to use G_GNUC_PRINTF (n, 0).
2013-11-29 00:33:05 +01:00
Michael Natterer 64438c1b4e Bug 694028 - statusbar cancel button for plug-ins is hard to discover
Add the word "Cancel" next to the cancel icon, the button is only
visible during a plug-in progress anyway, so no space is wasted.
2013-03-18 01:26:44 +01:00
Michael Natterer fc19348621 app: consider the label in GimpStatusbar's size negotiation
doesn't change anything, except perhaps for weird themes.
2013-03-10 19:54:42 +01:00
Michael Natterer fcfb7cf160 Use the new g_[s]list_free_full() instead of foreach() and free() 2011-03-07 17:11:28 +01:00
Michael Natterer 6bf13efbc8 app: use gimp_widget_flush_expose() for the statusbar's progress 2010-11-10 00:16:34 +01:00
Michael Natterer 59a4e70b86 app: don't reserve a height for the statusbar label's icon
Reserve only a width. The height gets ignored by GTK+ 2.x and breaks
layout positioning in GTK+ 3.x which uses pango-cairo for all text
rendering.
2010-10-29 10:31:04 +02:00
Michael Natterer 74458f46ee app/libgimpwidgets: move GimpUnitStore and GimpUnitComboBox to libgimpwidgets 2010-10-14 22:15:25 +02:00
Michael Natterer 0e17e44ba4 app: move code from GtkObject::destroy() to GObject::dispose() 2010-09-26 22:35:49 +02:00
Michael Natterer ac80163771 app: draw the statusbar's icon with cairo 2010-07-30 13:14:10 +02:00
Michael Natterer 372eabdd48 app: avoid using sealed GtkStatusbar members
Instead keep a pointer to the statusbar's label around in our own
object struct. Also remove conditional compilation based in GTK+
version.
2010-04-20 09:56:59 +02:00
Michael Natterer 0908e53148 app: use the new unit conversion functions
and get rid of the brainfuck idea that app/ has to use _gimp_unit_foo()
functions, passing a gimp pointer. Instead, simply use the libgimpbase
API all over the place. Should we ever allow more than one gimp instance,
they will simply have to share one unit database.
2010-02-21 16:46:39 +01:00
Michael Natterer 56ec0c8774 display: reserve more space for the cursor label so negative coords fit 2010-02-11 19:55:20 +01:00