[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [krita/rempt/T1004-recreate-the-text-tool] plugins/tools/svgtexttool: Add a rich text editor tab, at
From:       Wolthera_van_Hövell_tot_Westerflier <null () kde ! org>
Date:       2017-06-30 20:45:55
Message-ID: E1dR2nb-0005oB-3l () code ! kde ! org
[Download RAW message or body]

Git commit 55084c1111bbd990094b9fbb51e97c1b0b0ef83c by Wolthera van Hövell tot \
Westerflier. Committed on 30/06/2017 at 20:45.
Pushed by woltherav into branch 'rempt/T1004-recreate-the-text-tool'.

Add a rich text editor tab, attach some functions, and other stuff.

Don't code when traveling, this ends with attempting to do 5 things at once...

M  +256  -70   plugins/tools/svgtexttool/SvgTextEditor.cpp
M  +27   -5    plugins/tools/svgtexttool/SvgTextEditor.h
M  +209  -90   plugins/tools/svgtexttool/WdgSvgTextEditor.ui

https://commits.kde.org/krita/55084c1111bbd990094b9fbb51e97c1b0b0ef83c

diff --git a/plugins/tools/svgtexttool/SvgTextEditor.cpp \
b/plugins/tools/svgtexttool/SvgTextEditor.cpp index c1275c4341b..a6a9d1cbf90 100644
--- a/plugins/tools/svgtexttool/SvgTextEditor.cpp
+++ b/plugins/tools/svgtexttool/SvgTextEditor.cpp
@@ -24,12 +24,17 @@
 #include <QUrl>
 #include <QPushButton>
 #include <QDebug>
+#include <QAction>
+#include <QMenu>
+#include <QTabWidget>
 
 #include <klocalizedstring.h>
 
 #include "KoSvgTextShape.h"
 #include "KoSvgTextShapeMarkupConverter.h"
+#include <KoColorSpaceRegistry.h>
 
+#include <kis_icon.h>
 #include <kis_file_name_requester.h>
 #include <BasicXMLSyntaxHighlighter.h>
 
@@ -41,24 +46,64 @@ SvgTextEditor::SvgTextEditor(QWidget *parent, Qt::WindowFlags \
flags)  widget.setupUi(m_page);
     setMainWidget(m_page);
 
-    BasicXMLSyntaxHighlighter *hl = new BasicXMLSyntaxHighlighter(widget.textEdit);
+    BasicXMLSyntaxHighlighter *hl = new \
BasicXMLSyntaxHighlighter(widget.svgTextEdit);  Q_UNUSED(hl);
 
     connect(this, SIGNAL(okClicked()), SLOT(save()));
-    connect(widget.bnUndo, SIGNAL(clicked()), widget.textEdit, SLOT(undo()));
-    connect(widget.bnRedo, SIGNAL(clicked()), widget.textEdit, SLOT(redo()));
-    connect(widget.bnCopy, SIGNAL(clicked()), widget.textEdit, SLOT(copy()));
-    connect(widget.bnCut, SIGNAL(clicked()), widget.textEdit, SLOT(cut()));
-    connect(widget.bnPaste, SIGNAL(clicked()), widget.textEdit, SLOT(paste()));
-
-    connect(widget.bnBold, SIGNAL(clicked()), this, SLOT(setTextBold()));
-    connect(widget.bnItalic, SIGNAL(clicked()), this, SLOT(setTextItalic()));
-    connect(widget.bnUnderline, SIGNAL(clicked()), this, SLOT(setTextUnderline()));
-    connect(widget.bnStrikethrough, SIGNAL(clicked()), this, \
SLOT(setTextStrikeThrough())); +    connect(widget.bnUndo, SIGNAL(clicked()), \
widget.svgTextEdit, SLOT(undo())); +    connect(widget.bnRedo, SIGNAL(clicked()), \
widget.svgTextEdit, SLOT(redo())); +    connect(widget.bnCopy, SIGNAL(clicked()), \
widget.svgTextEdit, SLOT(copy())); +    connect(widget.bnCut, SIGNAL(clicked()), \
widget.svgTextEdit, SLOT(cut())); +    connect(widget.bnPaste, SIGNAL(clicked()), \
widget.svgTextEdit, SLOT(paste())); +    connect(widget.textTab, \
SIGNAL(currentChanged(int)), this, SLOT(switchTextEditorTab())); +    \
switchTextEditorTab(); +
+    //make actions here//
+    QAction *makeBold = new QAction(KisIconUtils::loadIcon("format-text-bold"), \
"Bold"); +    connect(makeBold, SIGNAL(triggered(bool)), this, SLOT(setTextBold()));
+    QAction *makeWeightLight = new QAction("Light");
+    connect(makeWeightLight, SIGNAL(triggered(bool)), this, \
SLOT(setTextWeightLight())); +    QAction *makeWeightNormal = new QAction("Normal");
+    connect(makeWeightNormal, SIGNAL(triggered(bool)), this, \
SLOT(setTextWeightNormal())); +    QAction *makeWeightDemi = new \
QAction("Demi-Bold"); +    connect(makeWeightDemi, SIGNAL(triggered(bool)), this, \
SLOT(setTextWeightDemi())); +    QAction *makeWeightBlack = new QAction("Black");
+    connect(makeWeightBlack, SIGNAL(triggered(bool)), this, \
SLOT(setTextWeightBlack())); +    widget.bnBold->setDefaultAction(makeBold);
+    QList<QAction*> textWeightActions;
+    textWeightActions.append(makeWeightLight);
+    textWeightActions.append(makeWeightNormal);
+    textWeightActions.append(makeWeightDemi);
+    textWeightActions.append(makeBold);
+    textWeightActions.append(makeWeightBlack);
+    QMenu *textWeight = new QMenu();
+    textWeight->addActions(textWeightActions);
+    widget.bnBold->setMenu(textWeight);
+
+    QAction *makeItalic = new QAction(KisIconUtils::loadIcon("format-text-italic"), \
"Italic"); +    connect(makeItalic, SIGNAL(triggered(bool)), this, \
SLOT(setTextItalic())); +    widget.bnItalic->setDefaultAction(makeItalic);
+
+    QAction *makeUnderline = new \
QAction(KisIconUtils::loadIcon("format-text-underline"), "Underline"); +    \
connect(makeUnderline, SIGNAL(triggered(bool)), this, SLOT(setTextUnderline())); +    \
widget.bnUnderline->setDefaultAction(makeUnderline); +    QAction *makeStrike = new \
QAction(KisIconUtils::loadIcon("format-text-strikethrough"), "Strikethrough"); +    \
connect(makeStrike, SIGNAL(triggered(bool)), this, SLOT(setTextStrikethrough())); +   \
QAction *makeOverline = new QAction("Overline"); +    connect(makeOverline, \
SIGNAL(triggered(bool)), this, SLOT(setTextOverline())); +    QList<QAction*> \
textDecorActions; +    textDecorActions.append(makeUnderline);
+    textDecorActions.append(makeStrike);
+    textDecorActions.append(makeOverline);
+    QMenu *textDecoration = new QMenu();
+    textDecoration->addActions(textDecorActions);
+    widget.bnUnderline->setMenu(textDecoration);
+    widget.bnStrikethrough->setDefaultAction(makeStrike);
+
     connect(widget.bnTextFgColor, SIGNAL(changed(KoColor)), this, \
                SLOT(setTextFill()));
     connect(widget.bnTextBgColor, SIGNAL(changed(KoColor)), this, \
                SLOT(setTextStroke()));
-    connect(widget.bnSuperscript, SIGNAL(clicked()), this, SLOT(setSuperscript()));
-    connect(widget.bnSubscript, SIGNAL(clicked()), this, SLOT(setSubscript()));
+    //connect(widget.bnSuperscript, SIGNAL(clicked()), this, \
SLOT(setSuperscript())); +    //connect(widget.bnSubscript, SIGNAL(clicked()), this, \
                SLOT(setSubscript()));
     connect(widget.fontComboBox, SIGNAL(currentFontChanged(const QFont)), this, \
                SLOT(setFont()));
     connect(widget.fontSize, SIGNAL(editingFinished()), this, SLOT(setSize()));
 }
@@ -75,8 +120,8 @@ void SvgTextEditor::setShape(KoSvgTextShape *shape)
         QString svg;
         QString styles;
         if (converter.convertToSvg(&svg, &styles)) {
-            //widget.textEdit->setPlainText(QString("%1\n%2").arg(defs).arg(svg));
-            widget.textEdit->setPlainText(svg);
+            //widget.svgTextEdit->setPlainText(QString("%1\n%2").arg(defs).arg(svg));
 +            widget.svgTextEdit->setPlainText(svg);
         }
         else {
             qWarning() << "Could not get svg text from the shape:" << \
converter.errors() << converter.warnings(); @@ -88,69 +133,209 @@ void \
SvgTextEditor::setShape(KoSvgTextShape *shape)  void SvgTextEditor::save()
 {
     // We don't do defs or styles yet...
-    emit textUpdated(widget.textEdit->document()->toPlainText(), "");
+    emit textUpdated(widget.svgTextEdit->document()->toPlainText(), "");
     hide();
 }
 
-void SvgTextEditor::setTextBold()
+void SvgTextEditor::switchTextEditorTab()
 {
-    QTextCursor cursor = widget.textEdit->textCursor();
-    if (cursor.hasSelection()) {
-        QString selectionModified = "<tspan style='font-weight:700;'>" + \
                cursor.selectedText() + "</tspan>";
-        cursor.removeSelectedText();
-        cursor.insertText(selectionModified);
+    if (widget.textTab->currentIndex() == Richtext) {
+        //first, make buttons checkable
+        widget.bnBold->setCheckable(true);
+        widget.bnItalic->setCheckable(true);
+        widget.bnUnderline->setCheckable(true);
+        //then connec the cursor change to the checkformat();
+        connect(widget.richTextEdit, SIGNAL(cursorPositionChanged()), this, \
SLOT(checkFormat())); +
+        //implement svg to richtext here.
+    } else {
+        //first, make buttons uncheckable
+        widget.bnBold->setCheckable(false);
+        widget.bnItalic->setCheckable(false);
+        widget.bnUnderline->setCheckable(false);
+        disconnect(widget.richTextEdit, SIGNAL(cursorPositionChanged()), this, \
SLOT(checkFormat())); +
+        //implement richtext to svg here.
     }
 }
 
-void SvgTextEditor::setTextItalic()
+void SvgTextEditor::checkFormat()
 {
-    QTextCursor cursor = widget.textEdit->textCursor();
-    if (cursor.hasSelection()) {
-        QString selectionModified = "<tspan style='font-style:italic;'>" + \
                cursor.selectedText() + "</tspan>";
-        cursor.removeSelectedText();
-        cursor.insertText(selectionModified);
+    QTextCharFormat format = widget.richTextEdit->textCursor().charFormat();
+    if (format.fontWeight()>QFont::Normal) {
+        widget.bnBold->setChecked(true);
+    } else {
+        widget.bnBold->setChecked(false);
     }
+    widget.bnItalic->setChecked(format.fontItalic());
+    widget.bnUnderline->setChecked(format.fontUnderline());
+    //widget.fontComboBox->setCurrentFont(format.font());
+    widget.fontSize->setValue(format.fontPointSize());
+    KoColor color(format.foreground().color(), \
KoColorSpaceRegistry::instance()->rgb8()); +    \
widget.bnTextFgColor->setColor(color);  }
 
-void SvgTextEditor::setTextUnderline()
+void SvgTextEditor::setTextBold(QFont::Weight weight)
 {
-    QTextCursor cursor = widget.textEdit->textCursor();
-    if (cursor.hasSelection()) {
-        QString selectionModified = "<tspan style='text-decoration:underline;'>" + \
                cursor.selectedText() + "</tspan>";
-        cursor.removeSelectedText();
-        cursor.insertText(selectionModified);
+    if (widget.textTab->currentIndex() == Richtext) {
+        QTextCharFormat format;
+        if (widget.richTextEdit->textCursor().charFormat().fontWeight()>QFont::Normal \
&& weight==QFont::Bold) { +            format.setFontWeight(QFont::Normal);
+        } else {
+            format.setFontWeight(weight);
+        }
+        widget.richTextEdit->mergeCurrentCharFormat(format);
+    } else {
+        QTextCursor cursor = widget.svgTextEdit->textCursor();
+        if (cursor.hasSelection()) {
+            QString selectionModified = "<tspan style=\"font-weight:700;\">" + \
cursor.selectedText() + "</tspan>"; +            cursor.removeSelectedText();
+            cursor.insertText(selectionModified);
+        }
     }
 }
 
-void SvgTextEditor::setTextStrikeThrough()
+void SvgTextEditor::setTextWeightLight()
 {
-    QTextCursor cursor = widget.textEdit->textCursor();
-    if (cursor.hasSelection()) {
-        QString selectionModified = "<tspan style='text-decoration:line-through;'>" \
                + cursor.selectedText() + "</tspan>";
-        cursor.removeSelectedText();
-        cursor.insertText(selectionModified);
+    if (widget.richTextEdit->textCursor().charFormat().fontWeight()<QFont::Normal) {
+        setTextBold(QFont::Normal);
+    } else {
+        setTextBold(QFont::Light);
+    }
+}
+
+void SvgTextEditor::setTextWeightNormal()
+{
+    setTextBold(QFont::Normal);
+}
+
+void SvgTextEditor::setTextWeightDemi()
+{
+    if (widget.richTextEdit->textCursor().charFormat().fontWeight()>QFont::Normal
+            && widget.richTextEdit->textCursor().charFormat().fontWeight()<QFont::Normal) \
{ +        setTextBold(QFont::Normal);
+    } else {
+    setTextBold(QFont::DemiBold);
+    }
+}
+
+void SvgTextEditor::setTextWeightBlack()
+{
+    if (widget.richTextEdit->textCursor().charFormat().fontWeight()>QFont::Normal) {
+        setTextBold(QFont::Normal);
+    } else {
+    setTextBold(QFont::Black);
+    }
+}
+
+void SvgTextEditor::setTextItalic(QFont::Style style)
+{
+    QTextCursor cursor = widget.svgTextEdit->textCursor();
+    QString fontStyle = "inherit";
+    if (style == QFont::StyleItalic) {
+        fontStyle = "italic";
+    } else if(style == QFont::StyleOblique) {
+        fontStyle = "oblique";
+    }
+    if (widget.textTab->currentIndex() == Richtext) {
+        QTextCharFormat format;
+        format.setFontItalic(!widget.richTextEdit->textCursor().charFormat().fontItalic());
 +        widget.richTextEdit->mergeCurrentCharFormat(format);
+    } else {
+        if (cursor.hasSelection()) {
+            QString selectionModified = "<tspan \
style=\"font-style:"+fontStyle+";\">" + cursor.selectedText() + "</tspan>"; +         \
cursor.removeSelectedText(); +            cursor.insertText(selectionModified);
+        }
     }
 }
 
+void SvgTextEditor::setTextDecoration(KoSvgText::TextDecoration decor)
+{
+    QTextCursor cursor = widget.svgTextEdit->textCursor();
+    QTextCharFormat currentFormat = widget.richTextEdit->textCursor().charFormat();
+    QTextCharFormat format;
+    QString textDecoration = "inherit";
+    if (decor == KoSvgText::DecorationUnderline) {
+        textDecoration = "underline";
+        if (currentFormat.fontUnderline()) {
+        format.setFontUnderline(false);
+        } else {
+            format.setFontUnderline(true);
+        }
+        format.setFontOverline(false);
+        format.setFontStrikeOut(false);
+    } else if (decor == KoSvgText::DecorationLineThrough) {
+        textDecoration = "line-through";
+        format.setFontUnderline(false);
+        format.setFontOverline(false);
+        if (currentFormat.fontStrikeOut()) {
+        format.setFontStrikeOut(false);
+        } else {
+            format.setFontStrikeOut(true);
+        }
+    } else if (decor == KoSvgText::DecorationOverline) {
+        textDecoration = "overline";
+        format.setFontUnderline(false);
+        if (currentFormat.fontOverline()) {
+        format.setFontOverline(false);
+        } else {
+            format.setFontOverline(true);
+        }
+        format.setFontStrikeOut(false);
+    }
+    if (widget.textTab->currentIndex() == Richtext) {
+        widget.richTextEdit->mergeCurrentCharFormat(format);
+    } else {
+        if (cursor.hasSelection()) {
+            QString selectionModified = "<tspan \
style=\"text-decoration:"+textDecoration+";\">" + cursor.selectedText() + "</tspan>"; \
+            cursor.removeSelectedText(); +            \
cursor.insertText(selectionModified); +        }
+    }
+}
+
+void SvgTextEditor::setTextUnderline()
+{
+    setTextDecoration();
+}
+
+void SvgTextEditor::setTextOverline()
+{
+    setTextDecoration(KoSvgText::DecorationOverline);
+}
+
+void SvgTextEditor::setTextStrikethrough()
+{
+    setTextDecoration(KoSvgText::DecorationLineThrough);
+}
+
 void SvgTextEditor::setTextFill()
 {
     KoColor c = widget.bnTextFgColor->color();
     QColor color = c.toQColor();
-    QTextCursor cursor = widget.textEdit->textCursor();
+    QTextEdit t;
+    if (widget.textTab->currentIndex() == Richtext) {
+        QTextCharFormat format;
+        format.setForeground(QBrush(color));
+        widget.richTextEdit->mergeCurrentCharFormat(format);
+    } else {
+    QTextCursor cursor = widget.svgTextEdit->textCursor();
     if (cursor.hasSelection()) {
-        QString selectionModified = "<tspan fill='"+color.name()+"'>" + \
cursor.selectedText() + "</tspan>"; +        QString selectionModified = "<tspan \
fill=\""+color.name()+"\">" + cursor.selectedText() + "</tspan>";  \
cursor.removeSelectedText();  cursor.insertText(selectionModified);
     }
+    }
 }
 
 void SvgTextEditor::setTextStroke()
 {
     KoColor c = widget.bnTextBgColor->color();
     QColor color = c.toQColor();
-    QTextCursor cursor = widget.textEdit->textCursor();
+    QTextCursor cursor = widget.svgTextEdit->textCursor();
     if (cursor.hasSelection()) {
-        QString selectionModified = "<tspan stroke='"+color.name()+"'>" + \
cursor.selectedText() + "</tspan>"; +        QString selectionModified = "<tspan \
stroke=\""+color.name()+"\">" + cursor.selectedText() + "</tspan>";  \
cursor.removeSelectedText();  cursor.insertText(selectionModified);
     }
@@ -159,31 +344,43 @@ void SvgTextEditor::setTextStroke()
 void SvgTextEditor::setFont()
 {
     QString fontName = widget.fontComboBox->currentFont().family();
-    QTextCursor cursor = widget.textEdit->textCursor();
-    if (cursor.hasSelection()) {
-        QString selectionModified = "<tspan style='font-family:"+fontName+";'>" + \
                cursor.selectedText() + "</tspan>";
-        cursor.removeSelectedText();
-        cursor.insertText(selectionModified);
+    if (widget.textTab->currentIndex() == Richtext) {
+        QTextCharFormat format;
+        format.setFontFamily(fontName);
+        widget.richTextEdit->mergeCurrentCharFormat(format);
+    } else {
+        QTextCursor cursor = widget.svgTextEdit->textCursor();
+        if (cursor.hasSelection()) {
+            QString selectionModified = "<tspan \
style=\"font-family:"+fontName+";\">" + cursor.selectedText() + "</tspan>"; +         \
cursor.removeSelectedText(); +            cursor.insertText(selectionModified);
+        }
     }
 }
 
 void SvgTextEditor::setSize()
 {
     QString fontSize = QString::number(widget.fontSize->value());
-    QTextCursor cursor = widget.textEdit->textCursor();
-    if (cursor.hasSelection()) {
-        QString selectionModified = "<tspan style='font-size:"+fontSize+";'>" + \
                cursor.selectedText() + "</tspan>";
-        cursor.removeSelectedText();
-        cursor.insertText(selectionModified);
+    if (widget.textTab->currentIndex() == Richtext) {
+        QTextCharFormat format;
+        format.setFontPointSize((qreal)widget.fontSize->value());
+        widget.richTextEdit->mergeCurrentCharFormat(format);
+    } else {
+        QTextCursor cursor = widget.svgTextEdit->textCursor();
+        if (cursor.hasSelection()) {
+            QString selectionModified = "<tspan style=\"font-size:"+fontSize+";\">" \
+ cursor.selectedText() + "</tspan>"; +            cursor.removeSelectedText();
+            cursor.insertText(selectionModified);
+        }
     }
 }
 
-void SvgTextEditor::setSubscript()
+void SvgTextEditor::setBaseline(KoSvgText::BaselineShiftMode)
 {
-    QString fontSize = QString::number(widget.fontSize->value());
-    QTextCursor cursor = widget.textEdit->textCursor();
+
+    QTextCursor cursor = widget.svgTextEdit->textCursor();
     if (cursor.hasSelection()) {
-        QString selectionModified = "<tspan \
style='font-size:50%;baseline-shift:sub;'>" + cursor.selectedText() + "</tspan>"; +   \
QString selectionModified = "<tspan style=\"font-size:50%;baseline-shift:super;\">" + \
cursor.selectedText() + "</tspan>";  cursor.removeSelectedText();
         cursor.insertText(selectionModified);
     }
@@ -194,18 +391,7 @@ void SvgTextEditor::wheelEvent(QWheelEvent *event)
     if (event->modifiers() & Qt::ControlModifier) {
         int numDegrees = event->delta() / 8;
         int numSteps = numDegrees / 7;
-        widget.textEdit->zoomOut(numSteps);
+        widget.svgTextEdit->zoomOut(numSteps);
         event->accept();
     }
 }
-
-void SvgTextEditor::setSuperscript()
-{
-    QString fontSize = QString::number(widget.fontSize->value());
-    QTextCursor cursor = widget.textEdit->textCursor();
-    if (cursor.hasSelection()) {
-        QString selectionModified = "<tspan \
                style='font-size:50%;baseline-shift:super;'>" + cursor.selectedText() \
                + "</tspan>";
-        cursor.removeSelectedText();
-        cursor.insertText(selectionModified);
-    }
-}
diff --git a/plugins/tools/svgtexttool/SvgTextEditor.h \
b/plugins/tools/svgtexttool/SvgTextEditor.h index b9145ff9c63..d68e6421e53 100644
--- a/plugins/tools/svgtexttool/SvgTextEditor.h
+++ b/plugins/tools/svgtexttool/SvgTextEditor.h
@@ -27,6 +27,7 @@
 
 #include <KoDialog.h>
 #include <KoColor.h>
+#include <KoSvgText.h>//for the enums
 
 class KoSvgTextShape;
 class KisFileNameRequester;
@@ -38,22 +39,43 @@ public:
     SvgTextEditor(QWidget *parent = 0, Qt::WindowFlags flags = 0);
     ~SvgTextEditor();
 
+    //tiny enum to keep track of the tab on which editor something happens while \
keeping the code readable. +    enum Editor {
+        Richtext, // 0
+        SVGsource // 1
+    };
+
     void setShape(KoSvgTextShape *shape);
 
 private Q_SLOTS:
 
     void save();
+    /**
+     * switch the text editor tab.
+     */
+    void switchTextEditorTab();
+    /**
+     * in rich text, check the current format, and toggle the given buttons.
+     */
+    void checkFormat();
+
+    void setTextBold(QFont::Weight weight = QFont::Bold);
+    void setTextWeightLight();
+    void setTextWeightNormal();
+    void setTextWeightDemi();
+    void setTextWeightBlack();
 
-    void setTextBold();
-    void setTextItalic();
+    void setTextItalic(QFont::Style style = QFont::StyleOblique);
+    void setTextDecoration(KoSvgText::TextDecoration decor = \
KoSvgText::DecorationUnderline);  void setTextUnderline();
-    void setTextStrikeThrough();
+    void setTextOverline();
+    void setTextStrikethrough();
+
     void setTextFill();
     void setTextStroke();
     void setFont();
     void setSize();
-    void setSuperscript();
-    void setSubscript();
+    void setBaseline(KoSvgText::BaselineShiftMode baseline);
 
 Q_SIGNALS:
 
diff --git a/plugins/tools/svgtexttool/WdgSvgTextEditor.ui \
b/plugins/tools/svgtexttool/WdgSvgTextEditor.ui index e312d1c1466..87c48dc66b8 100644
--- a/plugins/tools/svgtexttool/WdgSvgTextEditor.ui
+++ b/plugins/tools/svgtexttool/WdgSvgTextEditor.ui
@@ -61,6 +61,9 @@
             <iconset theme="format-text-bold">
              <normaloff>.</normaloff>.</iconset>
            </property>
+           <property name="popupMode">
+            <enum>QToolButton::MenuButtonPopup</enum>
+           </property>
           </widget>
          </item>
          <item>
@@ -89,6 +92,9 @@
             <iconset theme="format-text-underline">
              <normaloff>.</normaloff>.</iconset>
            </property>
+           <property name="popupMode">
+            <enum>QToolButton::MenuButtonPopup</enum>
+           </property>
           </widget>
          </item>
          <item>
@@ -188,85 +194,167 @@
       <attribute name="title">
        <string>Paragraph</string>
       </attribute>
-      <layout class="QHBoxLayout" name="horizontalLayout_3">
+      <layout class="QVBoxLayout" name="verticalLayout_4">
        <item>
-        <widget class="QToolButton" name="bnJustifyLeft">
-         <property name="text">
-          <string>...</string>
-         </property>
-         <property name="icon">
-          <iconset theme="format-justify-left">
-           <normaloff>.</normaloff>.</iconset>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="QToolButton" name="bnJustifyCenter">
-         <property name="text">
-          <string>...</string>
-         </property>
-         <property name="icon">
-          <iconset theme="format-justify-center">
-           <normaloff>.</normaloff>.</iconset>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="QToolButton" name="bnJustifyRight">
-         <property name="text">
-          <string>...</string>
-         </property>
-         <property name="icon">
-          <iconset theme="format-justify-right">
-           <normaloff>.</normaloff>.</iconset>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="QToolButton" name="bnJustifyFill">
-         <property name="text">
-          <string>...</string>
-         </property>
-         <property name="icon">
-          <iconset theme="format-justify-fill">
-           <normaloff>.</normaloff>.</iconset>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="QToolButton" name="bnIndentLess">
-         <property name="text">
-          <string>...</string>
-         </property>
-         <property name="icon">
-          <iconset theme="format-text-indent-less">
-           <normaloff>.</normaloff>.</iconset>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="QToolButton" name="bnIndentMore">
-         <property name="text">
-          <string>...</string>
-         </property>
-         <property name="icon">
-          <iconset theme="format-indent-mode">
-           <normaloff>.</normaloff>.</iconset>
-         </property>
-        </widget>
+        <layout class="QHBoxLayout" name="horizontalLayout_5">
+         <item>
+          <widget class="QToolButton" name="bnJustifyLeft">
+           <property name="toolTip">
+            <string>Align text to the left.</string>
+           </property>
+           <property name="text">
+            <string>...</string>
+           </property>
+           <property name="icon">
+            <iconset theme="format-justify-left">
+             <normaloff>.</normaloff>.</iconset>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QToolButton" name="bnJustifyCenter">
+           <property name="toolTip">
+            <string>Align text to the center.</string>
+           </property>
+           <property name="text">
+            <string>...</string>
+           </property>
+           <property name="icon">
+            <iconset theme="format-justify-center">
+             <normaloff>.</normaloff>.</iconset>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QToolButton" name="bnJustifyRight">
+           <property name="toolTip">
+            <string>Align text to the right.</string>
+           </property>
+           <property name="text">
+            <string>...</string>
+           </property>
+           <property name="icon">
+            <iconset theme="format-justify-right">
+             <normaloff>.</normaloff>.</iconset>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QToolButton" name="bnJustifyFill">
+           <property name="toolTip">
+            <string>Align text justified.</string>
+           </property>
+           <property name="text">
+            <string>...</string>
+           </property>
+           <property name="icon">
+            <iconset theme="format-justify-fill">
+             <normaloff>.</normaloff>.</iconset>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QToolButton" name="bnIndentLess">
+           <property name="toolTip">
+            <string>Indent less</string>
+           </property>
+           <property name="text">
+            <string>...</string>
+           </property>
+           <property name="icon">
+            <iconset theme="format-indent-less"/>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QToolButton" name="bnIndentMore">
+           <property name="toolTip">
+            <string>Indent more.</string>
+           </property>
+           <property name="text">
+            <string>...</string>
+           </property>
+           <property name="icon">
+            <iconset theme="format-indent-more"/>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <spacer name="horizontalSpacer_2">
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+        </layout>
        </item>
        <item>
-        <spacer name="horizontalSpacer_2">
-         <property name="orientation">
-          <enum>Qt::Horizontal</enum>
-         </property>
-         <property name="sizeHint" stdset="0">
-          <size>
-           <width>40</width>
-           <height>20</height>
-          </size>
-         </property>
-        </spacer>
+        <layout class="QFormLayout" name="formLayout">
+         <item row="0" column="0">
+          <widget class="QLabel" name="label_3">
+           <property name="text">
+            <string>Line-height</string>
+           </property>
+          </widget>
+         </item>
+         <item row="0" column="1">
+          <widget class="QDoubleSpinBox" name="spbLineHeight">
+           <property name="toolTip">
+            <string>The difference at which a new line is started.</string>
+           </property>
+           <property name="prefix">
+            <string/>
+           </property>
+           <property name="suffix">
+            <string>x</string>
+           </property>
+          </widget>
+         </item>
+         <item row="2" column="0">
+          <widget class="QLabel" name="label">
+           <property name="text">
+            <string>Letter-spacing</string>
+           </property>
+          </widget>
+         </item>
+         <item row="2" column="1">
+          <widget class="QDoubleSpinBox" name="snbLetterSpacing">
+           <property name="toolTip">
+            <string>Spacing between</string>
+           </property>
+          </widget>
+         </item>
+         <item row="4" column="1">
+          <widget class="QCheckBox" name="chkKerning">
+           <property name="toolTip">
+            <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Whether on not to \
use the internal kerning tables of a \
font.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> +           </property>
+           <property name="text">
+            <string>Use Kerning tables if possible.</string>
+           </property>
+          </widget>
+         </item>
+         <item row="1" column="1">
+          <widget class="QDoubleSpinBox" name="spbWordSpacing">
+           <property name="toolTip">
+            <string>Adjust the spacing between words.</string>
+           </property>
+          </widget>
+         </item>
+         <item row="1" column="0">
+          <widget class="QLabel" name="label_2">
+           <property name="text">
+            <string>Word-spacing</string>
+           </property>
+          </widget>
+         </item>
+        </layout>
        </item>
       </layout>
      </widget>
@@ -298,7 +386,8 @@
         <string>...</string>
        </property>
        <property name="icon">
-        <iconset theme="edit-undo"/>
+        <iconset theme="edit-undo">
+         <normaloff>.</normaloff>.</iconset>
        </property>
       </widget>
      </item>
@@ -311,7 +400,8 @@
         <string>...</string>
        </property>
        <property name="icon">
-        <iconset theme="edit-redo"/>
+        <iconset theme="edit-redo">
+         <normaloff>.</normaloff>.</iconset>
        </property>
       </widget>
      </item>
@@ -324,7 +414,8 @@
         <string>...</string>
        </property>
        <property name="icon">
-        <iconset theme="edit-copy"/>
+        <iconset theme="edit-copy">
+         <normaloff>.</normaloff>.</iconset>
        </property>
       </widget>
      </item>
@@ -337,7 +428,8 @@
         <string>...</string>
        </property>
        <property name="icon">
-        <iconset theme="edit-cut"/>
+        <iconset theme="edit-cut">
+         <normaloff>.</normaloff>.</iconset>
        </property>
       </widget>
      </item>
@@ -350,7 +442,8 @@
         <string>...</string>
        </property>
        <property name="icon">
-        <iconset theme="edit-paste"/>
+        <iconset theme="edit-paste">
+         <normaloff>.</normaloff>.</iconset>
        </property>
       </widget>
      </item>
@@ -370,16 +463,42 @@
     </layout>
    </item>
    <item>
-    <widget class="QTextEdit" name="textEdit">
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="acceptRichText">
-      <bool>false</bool>
+    <widget class="QTabWidget" name="textTab">
+     <property name="currentIndex">
+      <number>0</number>
      </property>
+     <widget class="QWidget" name="richTab">
+      <attribute name="title">
+       <string>Rich text</string>
+      </attribute>
+      <layout class="QVBoxLayout" name="verticalLayout_5">
+       <item>
+        <widget class="QTextEdit" name="richTextEdit"/>
+       </item>
+      </layout>
+      <zorder>svgTextEdit</zorder>
+      <zorder>richTextEdit</zorder>
+     </widget>
+     <widget class="QWidget" name="svgTab">
+      <attribute name="title">
+       <string>SVG source</string>
+      </attribute>
+      <layout class="QHBoxLayout" name="horizontalLayout_6">
+       <item>
+        <widget class="QTextEdit" name="svgTextEdit">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="acceptRichText">
+          <bool>false</bool>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </widget>
     </widget>
    </item>
   </layout>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic