diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2022-04-09 14:30:22 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2022-04-13 01:35:08 +0200 |
commit | 3b8fd7dd69fd4d775e296cbbd3bf50c2efb41b39 (patch) | |
tree | 8abedb9a5764d8763c6732af16b381522fa12139 /sc/uiconfig | |
parent | 041e4760453787283d6cb19327b53cc3642d91fc (diff) |
sc: add UI, undo/redo and test to change sparkline data range
This adds a "edit sparkline" action to the context menu and a
dialog to change the data range of a sparkline. To change a
sparkline using undo/redo, a new class UndoEditSparkline was
added, which allows to change the attributes of a sparkline and
revert back the old attributes when undoing. This is then used in
the Dialog when setting the changed data range of a sparkline.
To make sure that undo/redo works correctly, a simple unit tests
was added.
Change-Id: I08af1813fa288278bc0d33b0540660b325b17235
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132748
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
(cherry picked from commit a08f9ed2341bc60faae6b86538661fea40417ace)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132924
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Diffstat (limited to 'sc/uiconfig')
-rw-r--r-- | sc/uiconfig/scalc/popupmenu/cell.xml | 1 | ||||
-rw-r--r-- | sc/uiconfig/scalc/ui/sparklinedatarangedialog.ui | 148 |
2 files changed, 149 insertions, 0 deletions
diff --git a/sc/uiconfig/scalc/popupmenu/cell.xml b/sc/uiconfig/scalc/popupmenu/cell.xml index 1de462b89fe1..fb7f4ff9ecd8 100644 --- a/sc/uiconfig/scalc/popupmenu/cell.xml +++ b/sc/uiconfig/scalc/popupmenu/cell.xml @@ -69,6 +69,7 @@ <menu:menuitem menu:id=".uno:DeleteSparkline"/> <menu:menuitem menu:id=".uno:DeleteSparklineGroup"/> <menu:menuitem menu:id=".uno:EditSparklineGroup"/> + <menu:menuitem menu:id=".uno:EditSparkline"/> <menu:menuitem menu:id=".uno:GroupSparklines"/> <menu:menuitem menu:id=".uno:UngroupSparklines"/> </menu:menupopup> diff --git a/sc/uiconfig/scalc/ui/sparklinedatarangedialog.ui b/sc/uiconfig/scalc/ui/sparklinedatarangedialog.ui new file mode 100644 index 000000000000..1e1412e01981 --- /dev/null +++ b/sc/uiconfig/scalc/ui/sparklinedatarangedialog.ui @@ -0,0 +1,148 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.38.2 --> +<interface domain="sc"> + <requires lib="gtk+" version="3.20"/> + <object class="GtkDialog" id="SparklineDataRangeDialog"> + <property name="can-focus">False</property> + <property name="border-width">6</property> + <property name="title" translatable="yes" context="SparklineDialog">Sparkline Data Range Dialog</property> + <property name="type-hint">dialog</property> + <child internal-child="vbox"> + <object class="GtkBox" id="dialog-vbox1"> + <property name="can-focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">12</property> + <child internal-child="action_area"> + <object class="GtkButtonBox" id="dialog-action_area1"> + <property name="can-focus">False</property> + <property name="layout-style">end</property> + <child> + <object class="GtkButton" id="ok"> + <property name="label" translatable="yes" context="stock">_OK</property> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="can-default">True</property> + <property name="has-default">True</property> + <property name="receives-default">True</property> + <property name="use-underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkButton" id="cancel"> + <property name="label" translatable="yes" context="stock">_Close</property> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="can-default">True</property> + <property name="receives-default">True</property> + <property name="use-underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + <child> + <object class="GtkButton" id="help"> + <property name="label" translatable="yes" context="stock">_Help</property> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">True</property> + <property name="use-underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">3</property> + <property name="secondary">True</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack-type">end</property> + <property name="position">2</property> + </packing> + </child> + <child> + <!-- n-columns=3 n-rows=1 --> + <object class="GtkGrid"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="margin-start">12</property> + <property name="margin-end">6</property> + <property name="margin-top">6</property> + <property name="margin-bottom">6</property> + <property name="row-spacing">6</property> + <property name="column-spacing">6</property> + <child> + <object class="GtkButton" id="cell-range-button"> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">True</property> + <accessibility> + <relation type="labelled-by" target="cell-range-label"/> + </accessibility> + </object> + <packing> + <property name="left-attach">2</property> + <property name="top-attach">0</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="cell-range-edit"> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="valign">center</property> + <property name="hexpand">True</property> + <property name="activates-default">True</property> + <property name="width-chars">30</property> + <property name="truncate-multiline">True</property> + <accessibility> + <relation type="labelled-by" target="cell-range-label"/> + </accessibility> + </object> + <packing> + <property name="left-attach">1</property> + <property name="top-attach">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="cell-range-label"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="label" translatable="yes" context="SparklineDataRangeDialog|cell-range-label">Data range:</property> + <property name="use-underline">True</property> + <property name="xalign">0</property> + <accessibility> + <relation type="label-for" target="cell-range-button"/> + <relation type="label-for" target="cell-range-edit"/> + </accessibility> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">0</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + </object> + </child> + <action-widgets> + <action-widget response="-5">ok</action-widget> + <action-widget response="-6">cancel</action-widget> + <action-widget response="-11">help</action-widget> + </action-widgets> + </object> +</interface> |