Commit Graph

55 Commits

Author SHA1 Message Date
Michael Natterer 822a7228c4 Bug 794221 - Recently used colors on text don't get added to the color history
Add signal GimpTextBuffer::color-applied which is emitted when text is
inserted or when color is applied to a span of text.

In GimpTextTool, connect to the signal and update the global color
history.

Unrelated: rename gimp_text_tag_get_color() to get_fg_color() and add
boolean return values to get_fg_color() and get_fg_color() which
indicates if a color is set on the tag at all. This ended up unneeded
in the fix but is an improvement regardless.
2018-03-23 14:19:01 +01:00
Michael Natterer 539927ebfa app: replace all g_assert() by the newly added gimp_assert()
which is just a #define to g_assert for now, but can now easily be
turned into something that does some nicer debugging using our new
stack trace infrastructure. This commit also reverts all constructed()
functions to use assert again.
2018-02-11 22:23:10 +01: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
Michael Natterer dda54c1df8 Deprecate stock items for good and change all icon defines to GIMP_ICON_*
Try to sort all GIMP_ICON_* defines into FDO categories like in
https://specifications.freedesktop.org/icon-naming-spec/latest/ar01s04.html

Add defines for all icons we override, rename some icons to their FDO
standard names, and mark the ones we duplicate with a comment so we
don't forget to rename those to standard names in 3.0.
2017-03-05 16:01:59 +01: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 312691312d icons: Bug 759904
add
gimp-shred

patch: replace "edit-clear" by "gimp-shred" (or GIMP_STOCK_SHRED)

gimp/app/actions/documents-commands.c:                                    "edit-clear",
gimp/gimp/app/actions/edit-actions.c:  { "edit-undo-clear", "edit-clear",
gimp/app/actions/documents-actions.c:  { "documents-clear", "edit-clear",
gimp/app/dialogs/preferences-dialog.c:  button = prefs_button_add ("edit-clear", shred

add
gimp-edit-clear

patch: replace "edit-clear" by "gimp-edit-clear" (or GIMP_STOCK_EDIT_CLEAR)

gimp/app/actions/text-editor-actions.c:  { "text-editor-clear", "edit-clear",
gimp/app/actions/edit-actions.c:  { "edit-clear", "edit-clear",
gimp/app/actions/error-console-actions.c:  { "error-console-clear", "edit-clear",
gimp/app/actions/text-tool-actions.c:  { "text-tool-clear", "edit-clear",
gimp/app/widgets/gimptextstyleeditor.c:  image = gtk_image_new_from_icon_name ("edit-clear", GTK_ICON_SIZE_MENU);
gimp/app/dialogs/preferences-dialog.c:  button = prefs_button_add ("edit-clear",


patch
gimpicons.c
gimpicons.h

update
icon-list.mk
2016-06-10 13:50:45 +02:00
Michael Natterer ace40d125d Bug 735891 - color areas in the color picker info window are half transparent
Add code to GimpOverlayChild which can render arbitrary children of
the widget fully opaque, ignoring the configured opacity.

Add gimp_widget_get,set_fully_opaque() which gets/sets a per-widget
boolean flag to trigger that code.

Set the color picker's and the text tool style widget's color areas to
fully opaque.
2015-10-27 21:41:32 +01:00
Michael Natterer 981abdffe1 app: the icon's name is format-text-strikethrough not format-edit-strikethrough 2014-05-16 20:47:41 +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 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
Jehan 53d2059bd8 Bug 417704: font name for missing font is given in the font entry's help message.
When a font is missing, the name of the expected font will be displayed in the
help message through the text style editor with an explanatory message.
2013-05-17 20:59:46 +09:00
Michael Natterer 804313bbec Bug 694417 - GIMP Segmentation Faults (Segfault, Crash) after Changing Color...
Don't pass a NULL pointer to gimp_text_buffer_get_font_tag() because
it is dereferenced in a call to strcmp().

gimp_context_get_font_name() returns NULL when the selected text
includes spans with different fonts. Add the same special handling for
spans with inconsistent sizes too, and add comments that we should
have the same for the color.

Original patch from Massimo Valentini.
2013-04-21 17:51:08 +02:00
Jehan 20c86f821d Bug 689523: data bootstrap initial values in the text style editor at construction.
This was causing first a visual issue where the style editor UI would
show no default font/size/style at instanciation, but even a crash
when the user would change the font size or style (bold, italic...)
from this UI before selecting a font or writing a text.
2012-12-12 12:36:24 +09:00
Michael Natterer 908f727f0a Chain up unconditionally in GObject::constructed()
It's supported since GLib 2.28.
2012-11-12 21:51:22 +01:00
Michael Natterer f71afd245f app: remove redundant code from the last commit 2012-11-10 00:07:23 +01:00
Michael Natterer abd2e78bdf Bug 683011 - Text tool discards text attributes in the on-canvas dialog...
When font, size or color were changed, set the text buffer's current
insert_tags just as we already do for the bold, italic etc. toggle
buttons.  Changed gimp_text_style_editor_list_tags() to also return
the tags for font, size or color.
2012-11-09 23:06:45 +01:00
Massimo Valentini a29c096614 app: initialize also GimpRGB's alpha component
Conditional jump or move depends on uninitialised value(s)
==29000==    at 0x4C33CBC: gimp_color_area_set_color (gimp/libgimpwidgets/gimpcolorarea.c:425)
==29000==    by 0x4C3505B: gimp_color_button_set_color (gimp/libgimpwidgets/gimpcolorbutton.c:642)
==29000==    by 0x5DA5BE: gimp_text_style_editor_set_color (gimp/app/widgets/gimptextstyleeditor.c:700)
==29000==    by 0x5DB0D4: gimp_text_style_editor_update_idle (gimp/app/widgets/gimptextstyleeditor.c:1090)
==29000==    by 0x57E9E95: gdk_threads_dispatch (gtk-2-24/gdk/gdk.c:512)

Steps to reproduce:

<Ctrl>N <Enter> T
click on canvas
type something

select the text entered and change its color using
the color button from the text style editor
2012-03-13 20:44:47 +01:00
Michael Natterer 2414301799 Review the last few commits and apply some style fanaticism
some completely unrelated,
2012-02-07 20:36:55 +01:00
Massimo Valentini 39368a410d plugged memory leaks 2012-02-07 17:32:02 +01:00
Michael Natterer dcf84f3910 app: set the correct resolution on the text style overlay's size entry 2011-12-03 23:56:51 +01:00
Michael Natterer 3e336199b9 app: use gtk_box_new() 2011-09-30 11:29:11 +02:00
Michael Natterer a90961ef4a app: make GimpTextStyleEditor look a bit nicer
Add some spacing and move the color button to the bottom.
2011-03-21 01:00:37 +01:00
Michael Natterer 6d97fd3887 app: use a size entry instead of a spinbutton in GimpTextStyleEditor
so it's finally clear what unit the text size has.
2011-03-20 12:37:01 +01:00
Michael Natterer 140c9aae91 Bug 625273 - Insert Font and font-size into the Texteditor's Menubar
If the cursor position (or the current selection), doesn't contain any
font, font-size or color tags, display the default values from the
GimpText object instead of "nothing". Still display nothing if the
selection contains different fonts, sizes or colors.
2011-03-18 22:13:34 +01:00
Michael Natterer ecbfb4a9e8 app: add a GimpText property and construct param to GimpTextStyleEditor
which will be used to get default values from.
2011-03-18 21:16:53 +01:00
Michael Natterer 90058cded7 app: add missing tooltips in the text style overlay widget 2011-03-14 13:05:30 +01:00
Michael Natterer 4186d0114f app: add comment to improve readability 2011-01-20 20:26:34 +01:00
Michael Natterer 202124c438 app: implement GObject::constructed() instead of ::constructor() 2011-01-14 09:38:46 +01:00
Michael Natterer b9a7c121a4 app: don't inherit from GtkHBox or GtkVBox
Instead, inherit from GtkBox directly and set the orientation in
init().  Replace more gtk_container_add() by gtk_box_pack_start() in
the reparented classes.
2010-10-30 15:44:46 +02:00
Michael Natterer 68b380fa4e app: forgot to check for "color_differs" for breaking out of a loop
Shouldn't change anything, just be slightly faster in some cases.
2010-10-02 19:51:49 +02:00
Michael Natterer 81cfb44047 app: use a GimpColorPanel not a GimpColorButton in the text style editor
so we get proper color previews in the popup menu.
2010-09-29 21:14:51 +02:00
Michael Natterer bfce429d24 app: some minor fixes in GimpTextStyleEditor
- initialize all of the color strust in init().
- simplify font_changed().
2010-09-02 00:42:59 +02:00
Michael Natterer ad819263af Bug 620674 - Adding support for multi-colored text layer
Apply slightly modified patch from Barak Itkin that adds colors for
text spans plus GUI to edit these colors.
2010-09-02 00:20:04 +02:00
Michael Natterer 67ba62154e app: fix and improve text style overlay keyboard interaction
- app/widgets/gimptextstyleeditor.c: don't block all key events so
  they can reach the canvas.

- app/display/gimpdisplayshell-callbacks.c: instead, ignore canvas key
  events when the canvas has no focus.

This fixes navigating out of the text style editor with TAB, moving
focus to the canvas. I have no clue why navigating *between* the
widgets in the style editor doesn't work.
2010-05-12 19:00:18 +02:00
Michael Natterer a6b2d102f3 app: add utility functions for getting GtkTextTag properties
and also #define the names of the properties we (ab)use, so we don't
have to use magic strings all over the place, and we don't have to use
g_object_get() either.
2010-04-03 18:04:50 +02:00
Michael Natterer e856ca9552 app: handle kerning tags in the same way as baseline, size and font 2010-04-02 15:19:27 +02:00
Michael Natterer 2e1e5393fe app: make sure the baseline spinbutton always shows the right value 2010-03-31 19:13:46 +02:00
Michael Natterer b4e86aa6ec app: make sure the "size" spinbutton shows the size used for inserting text 2010-03-28 21:52:10 +02:00
Michael Natterer 91cce1c81b app: add size control for text spans, does not work as expected yet 2010-03-28 21:38:31 +02:00
Michael Natterer e003213784 app: move code for font entry and "size" label together 2010-03-06 22:54:12 +01:00
Michael Natterer 6fcb5c137d app: block all unhandled key events in the text style editor
so they don't affect the on-canvas editor.
2010-03-04 18:53:53 +01:00
Michael Natterer 8434bf9276 app: reorganize widgets in two lines
this so needs a clear ui concept...
2010-03-04 14:33:19 +01:00
Michael Natterer f766215548 app: add baseline and kerning controls to the style editor overlay
Involves adding GimpTextBuffer API to *set* baseline and kerning (as
opposed to changing it relatively from what it was).
2010-03-04 14:33:19 +01:00
Michael Natterer f230019f71 app: move updating the style editor to an idle function
so subsequent signals trigger only one update.
2010-03-02 11:46:58 +01:00
Michael Natterer 1ddef5d375 app: redo the buffer's tag-at-iter APIs and fix editor state update 2010-03-02 11:37:57 +01:00
Michael Natterer bea0c7f3d4 app: allow to select fonts on text spans
A bit hackish, will cleanup...
2010-03-02 11:11:06 +01:00
Michael Natterer aeac58089b app: add a font selector to the text style editor
Selects fonts just fine, but has no effect on the text yet.
2010-03-02 00:12:27 +01:00
Michael Natterer b19db0dea9 app: don't remove all tags when toggling style buttons and then inserting
Instead, keep a list of tags to explicitely remove around (the list of
unchecked toggles), and remove only these tags, so the tags that have
no widget in the UI are not affected by the insert_tags logic.
2010-03-01 22:39:42 +01:00
Michael Natterer f519b90a2b app: call begin_user_action() and end_user_action() around removing tags 2010-03-01 16:09:50 +01:00
Michael Natterer 65216b939d app: group text buffer changes by user actions
Use gtk_text_buffer_begin_user_action() and end_user_action() to group
all text buffer operations triggered by a single editing operation.
Connect to the buffer's "end-user-action" signal instead of to
"changed", "apply-tag" and "remove-tag" separately, so we only update
the text proxy once per user editing.
2010-02-28 17:15:06 +01:00