summaryrefslogtreecommitdiff
path: root/src/gui/styleeditor.cpp
diff options
context:
space:
mode:
authorAleks Kissinger <aleks0@gmail.com>2018-10-01 17:46:11 +0200
committerAleks Kissinger <aleks0@gmail.com>2018-10-01 17:46:11 +0200
commitf085393232f29237e7d6bfb1469d77a78e4a511a (patch)
tree7a7f47a659963f0a8b117982c1e85e1df59fbfe9 /src/gui/styleeditor.cpp
parente7a10091b64ddeb1d3e21e3f36abbf412021c815 (diff)
moving properties up and down
Diffstat (limited to 'src/gui/styleeditor.cpp')
-rw-r--r--src/gui/styleeditor.cpp35
1 files changed, 32 insertions, 3 deletions
diff --git a/src/gui/styleeditor.cpp b/src/gui/styleeditor.cpp
index fbf73a9..f6e3f48 100644
--- a/src/gui/styleeditor.cpp
+++ b/src/gui/styleeditor.cpp
@@ -447,17 +447,46 @@ void StyleEditor::on_addAtom_clicked()
void StyleEditor::on_removeProperty_clicked()
{
-
+ Style *s = activeStyle();
+ if (s != 0) {
+ QModelIndexList sel = ui->properties->selectionModel()->selectedRows();
+ if (!sel.isEmpty()) {
+ s->data()->removeRows(sel[0].row(), 1, sel[0].parent());
+ _dirty = true;
+ }
+ }
}
void StyleEditor::on_propertyUp_clicked()
{
-
+ Style *s = activeStyle();
+ if (s != 0) {
+ QModelIndexList sel = ui->properties->selectionModel()->selectedRows();
+ if (!sel.isEmpty()) {
+ s->data()->moveRows(
+ sel[0].parent(),
+ sel[0].row(), 1,
+ sel[0].parent(),
+ sel[0].row() - 1);
+ _dirty = true;
+ }
+ }
}
void StyleEditor::on_propertyDown_clicked()
{
-
+ Style *s = activeStyle();
+ if (s != 0) {
+ QModelIndexList sel = ui->properties->selectionModel()->selectedRows();
+ if (!sel.isEmpty()) {
+ s->data()->moveRows(
+ sel[0].parent(),
+ sel[0].row(), 1,
+ sel[0].parent(),
+ sel[0].row() + 2);
+ _dirty = true;
+ }
+ }
}
void StyleEditor::on_save_clicked()