Commit Graph

27351 Commits

Author SHA1 Message Date
Martin Nordholts 7b8352bfa0 app/tests: Make test that closes dock window use multi-column variant
Make test that closes dock window use multi-column variant so it
catches a bunch of warnings that occurs when closing multi-column dock
windows.
2010-03-07 09:00:08 +01:00
Martin Nordholts bdfbddd5e8 app/tests: Generalize gimp_ui_find_non_toolbox_dock_window()
Generalize gimp_ui_find_non_toolbox_dock_window() by renaming it to
gimp_ui_find_dock_window() and adding a parameter with a function that
will be used to find the toolbox.
2010-03-07 08:55:18 +01:00
Martin Nordholts a90a64707c app: Prevent multiple toolboxes through recently closed-list
There can only be one toolbox around, so if a new is created, make
sure to remove any toolbox entries from Recenly Closed Docks so a
toolbox can't be created that way.
2010-03-07 07:52:26 +01:00
Martin Nordholts beb8e450f0 app: Fix condition of what dock windows are added to recent-list
Add a helper function gimp_dock_window_should_add_to_recent() which
properly handles the toolbox with regards to what dock windows that
should be added to the list of recently closed docks.
2010-03-07 07:52:25 +01:00
Michael Natterer 6650693d29 app: move gimp_image_pick_layer() to its own file
and add a (still unused) text layer picking function.
2010-03-07 01:55:31 +01:00
Michael Natterer cda52f946c app: minor code cleanup (add local variable to improve readability) 2010-03-07 01:19:32 +01:00
Michael Natterer 2e5de8f6ab app: pass the cursor's PangoRectangle to gimp_draw_tool_draw_text_cursor()
and let the drawing function decide everything instead of doing some
cursor extents fiddling in the text tool.
2010-03-07 01:15:04 +01:00
Michael Natterer b9405d046a app: fix some corner cases in gimp_text_tool_button_release()
- request "click" releases instead of trying to detect them ourselves,
  but keep a minimum reasonable text layer size anyway (reduce it from
  20 to 3 pixels though).
- ignore RELEASE_CANCEL when selecting, we can't undo that yet.
- properly handle RELEASE_CANCEL when creating new lext layers (don't
  leave a dead overlay style editor around).
2010-03-07 00:53:32 +01:00
Michael Natterer a077d618ea app: no need any more to block drawing before non-text changes to the proxy 2010-03-07 00:21:51 +01:00
Michael Natterer 44f6d074a3 app: call gimp_text_tool_block_drawing() in proxy_notify()
so we also correctly handle non-text and non-markup changes (e.g. via
tool options). This is not exactly the right place to call
block_drawing(), but all places which change change the actual content
(and thus un-sync buffer and layout cursor posotions) already block
drawing before the actual buffer change happens.
2010-03-07 00:15:32 +01:00
Michael Natterer 2934095816 app: use gimp_text_layout_get_offsets()
instead of duplicating GimpTextLayout's positioning logic in two
different incomplete ways. Also gets rid of the unrelated offset
return values of gimp_text_tool_editor_get_cursor_rect().
2010-03-07 00:11:05 +01:00
Michael Natterer 1aeb315ecf undef GTK_DISABLE_DEPRECATED in many places which undef GSEAL_ENABLE
because the widget flag access macros (e.g. GTK_WIDGET_REALIZED) are
now deprecated in GTK+ master.
2010-03-06 23:14:29 +01:00
Michael Natterer e003213784 app: move code for font entry and "size" label together 2010-03-06 22:54:12 +01:00
Martin Nordholts 1010b497c2 app: Update dock window title when docks re added/removed
Update dock window title when docks re added/removed. We can also
remove the code that explicitly updated the title when a dock is
added.
2010-03-05 21:31:07 +01:00
Martin Nordholts 0279daed28 app: Make Toolbox dock title complete
Make the Toolbox dock title complete, i.e. if the toolbox dock
contains Tool Options, the title will be "Toolbox - Tool Options".
2010-03-05 21:31:07 +01:00
Martin Nordholts bfb8a94e19 menus: Move Windows→Toolbox entry out from list of open dock windows
Windows→Toolbox does not represent an open dock window, so it should
not be in the list of open dock windows.
2010-03-05 21:31:07 +01:00
Martin Nordholts 4cda04da5c app: Remove gimp_dock_window_get_dock()
Since the order of docks in a dock window is arbitrary, it can never
be correct to only care about the first dock. Remove
gimp_dock_window_get_dock() and correct that code that made use of
it. (The function itself was introduced when there could only be one
dock per dock window.)
2010-03-05 21:31:07 +01:00
Martin Nordholts cecae71034 app: Include all docks in dock window title 2010-03-05 21:31:06 +01:00
Martin Nordholts fc35ec4fe5 app: Fix magic number in gimp_canvas_draw_segments() 2010-03-05 21:31:06 +01:00
Miloš Popović 3ef9600395 Updated Serbian translations 2010-03-05 20:37:00 +01:00
Michael Natterer 15c5c0a036 po: update POTFILES.in 2010-03-05 16:38:18 +01:00
Michael Natterer e9f85b3afc app: block text buffer signals around copying to the clipboard
so the copying doesn't produce an undo step. Same fix as applied
earlier in button_press().
2010-03-05 10:53:09 +01:00
Michael Natterer 076948b4b7 app: don't leave drawing blocked in the error case 2010-03-05 10:50:50 +01:00
Michael Natterer 5284c9c836 app: fix text tool drawing for good this time (hopefully)
Earlier I claimed that drawing would work now because we make sure
that buffer and layout are always in sync. This was nonsense. In fact,
we constantly ran into the sutiation where the buffer was modified,
and we were drawing with the previous layout. It's unclear why this
didn't cause drawing artifacts, but it did cause e.g. the cursor
temporarily jumping to the next position while editing in the middle
of text (especially visible at line ends).

Several underlying problems existed: first, we now modify the buffer
from outside the text tool (from GimpTextStyleEditor) where we can't
pause the tool; second, proxy changes are handled asymetrically
(property changes are queued and processed all together in an idle
function) so we can't pause/resume drawing across the entire operation
because it has many beginnings and only one end.

Therefore:

- add gimp_text_tool_block_drawing()/unblock_drawing(), where block()
  can be called as many times as needed, and a single unblock()
  enables drawing again. block() also clears the layout, because it
  served its purpose (it was just used to pause drawing, and we know
  the buffer will change, so kill it).
- connect to GtkTextBuffer::begin-user-action and call block() from
  the callback, so we undraw stuff and kill the cached layout before
  any buffer change happens.
- call unblock() at the end of gimp_text_tool_apply() because then
  the text and the buffer are in sync again, the tool is undrawn and
  we can safely create the layout again to draw our stuff.
- also call block()/unblock() from some other places, like when a
  new text layer is created.
- get rid of *all* calls to draw_tool_pause()/resume() around buffer
  modifications, they are not needed any longer.
- add calls to begin/end_user_action() where they were missing.
2010-03-04 23:47:23 +01:00
Michael Natterer e54a05f78f app: get rid of gimp_text_tool_idle_apply()
and make gimp_text_tool_apply() itself the idle function. Might seem
like a bad idea, but is needed by an upcoming drawing refactoring.
2010-03-04 23:10:23 +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
Nils-Christoph Fiedler 35aebd76d6 Updated LowGerman translation 2010-03-04 01:09:44 +01:00
Aurimas Juška 73b86bd9c9 app: Fix GimpTag reference handling 2010-03-03 23:35:20 +02:00
Michael Natterer 9431376f55 app: cosmetic cleanup for readability 2010-03-03 10:53:01 +01:00
Michael Natterer bbd2d521f1 app: rename "spacing" to "kerning" because that's what it does 2010-03-03 10:48:42 +01:00
Michael Natterer 1d74c1f9cf app: don't overwrite all markup-set attributes with letter_spacing
if letter_spcaing is enabled. Instead add its attribute to the ones
which are already there.
2010-03-03 10:18:31 +01:00
Martin Nordholts 60e0496b1e Bug 610588 - Show Image Selection menu items visible in SWM 2010-03-03 07:39:14 +01:00
Michael Natterer 080f1a6ce4 app: fix editing text layers which don't contain markup
In gimp_text_tool_connect(), set either text *or* markup on the
buffer, or the latter will always override the former (now that text
and markup are mutually exclusive in GimpText).
2010-03-03 01:15:27 +01:00
Martin Nordholts 798e2e67e9 app: Move toolbox special casing into dialog factory
Move toolbox special casing into
gimp_dialog_factory_dialog_new_internal() and on the fly fix problems
with double toolboxes appearing and sometimes not appearing.
2010-03-02 22:38:15 +01:00
Martin Nordholts e4dee4c559 app: Cleanup gimp_dialog_factory_dialog_new_internal() a bit
Cleanup gimp_dialog_factory_dialog_new_internal() a bit with regards
to how it presents toplevel windows.
2010-03-02 22:38:15 +01:00
Michael Natterer 9a9d7489d1 app: make undo compression in the text tool work again
- in GimpText, make "text" and "markup" mutually exclusive, so that
  whenever one is set to non-NULL, the other is cleared automatically.
- add gimp_text_buffer_has_markup() which returns TRUE if any char
  in the buffer is tagged.
- in the text tool, only set "markup" on the text proxy if there is
  actually markup in the buffer, and set "text" otherwise.

This way we don't push "text" *and* "markup" undos on each keystroke,
and undo compression works the way it did before.
2010-03-02 21:54:24 +01:00
Michael Natterer e9abde75ee app: if there is no "text", generate the layer name from "markup"
Add gimp_markup_extract_text() which does just what it says (includes
code stolen from gmarkup.c), and use it if the layer's text object
doesn't have any text set.
2010-03-02 21:19:57 +01:00
Michael Natterer 842f1df2f2 Bug 611514 - Layers inside layer groups can't be dragged to layer dock buttons
In the drop callbacks, don't check if the GimpContainerView's container
contains the dropped item, it might be in a sub-container. Instead,
simply checking if the GimpContainerView knows the item is sufficient
(and also much simpler than a recursive container serach).
2010-03-02 17:54:29 +01:00
Michael Natterer 9c4864e789 app: optimize away redundant and expensive text layer re-rendering
- Add signal GimpText::changed() and emit it from
  GObject::dispatch_properties_changed() after all notifications have
  been emitted, so "changed" is emitted only once for any number of
  properties set within a g_object_freeze/thaw_notify() pair.
- Connect GimpTextLayer to "changed" instead of "notify" so we aviod
  lots of expensive re-rendering when multiple properties are set
  at once.
- Connect GimpTextTool to "notify" *and* "changed", and move some
  common code to the "changed" callback (e.g. we don't need to
  re-frame the item for each set property).
2010-03-02 17:44:31 +01:00
Michael Natterer 6d4f2c3431 Bug 565001 - Text-Tool crashes when edit a 2.4.2 version xcf
Need to convert to text->box_unit, not text->unit.
2010-03-02 15:24:17 +01:00
Michael Natterer 1fb61b8515 app: make sure mouse-selecting doesn't push an undo step
GtkTextBuffer emits "end-user-action" after something has been copied
to the clipboard. Work around that bug.
2010-03-02 13:04:37 +01:00
Michael Natterer 78ea82df1f app: simplify mouse selection by using iters instead of indices
This also removes the evil code dupication added yesterday, and is
generally less and cleaner code.
2010-03-02 12:23:29 +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 62af8de7ea app: no need to say shell->canvas when we are in a canvas callback 2010-03-02 00:11:47 +01:00
Michael Natterer dfc1671cb0 app: set a normal mouse cursor on all overlay children windows
so they don't show the parent's cursor (which is most likely
inappropriate on the canvas).
2010-03-01 23:45:16 +01:00