aboutsummaryrefslogtreecommitdiffstats
path: root/SQLiteStudio3/guiSQLiteStudio/multieditor
diff options
context:
space:
mode:
Diffstat (limited to 'SQLiteStudio3/guiSQLiteStudio/multieditor')
-rw-r--r--SQLiteStudio3/guiSQLiteStudio/multieditor/multieditor.cpp18
-rw-r--r--SQLiteStudio3/guiSQLiteStudio/multieditor/multieditor.h2
2 files changed, 19 insertions, 1 deletions
diff --git a/SQLiteStudio3/guiSQLiteStudio/multieditor/multieditor.cpp b/SQLiteStudio3/guiSQLiteStudio/multieditor/multieditor.cpp
index 2bae2f9..c99b774 100644
--- a/SQLiteStudio3/guiSQLiteStudio/multieditor/multieditor.cpp
+++ b/SQLiteStudio3/guiSQLiteStudio/multieditor/multieditor.cpp
@@ -26,6 +26,7 @@
#include <QToolButton>
#include <QDebug>
#include <QKeyEvent>
+#include <themetuner.h>
static QHash<QString,bool> missingEditorPluginsAlreadyWarned;
@@ -47,9 +48,17 @@ void MultiEditor::init()
QHBoxLayout* hbox = new QHBoxLayout();
hbox->setMargin(0);
- hbox->setSpacing(0);
+ hbox->setSpacing(10);
top->setLayout(hbox);
+ cornerLabel = new QLabel();
+ QFont font = cornerLabel->font();
+ font.setBold(true);
+ cornerLabel->setFont(font);
+ cornerLabel->setFrameStyle(QFrame::StyledPanel|QFrame::Plain);
+ hbox->addWidget(cornerLabel);
+ cornerLabel->setVisible(false);
+
nullCheck = new QCheckBox(tr("Null value", "multieditor"));
hbox->addWidget(nullCheck);
@@ -156,6 +165,7 @@ void MultiEditor::addEditor(MultiEditorWidget* editorWidget)
connect(editorWidget, SIGNAL(valueModified()), this, SLOT(invalidateValue()));
editors << editorWidget;
tabs->addTab(editorWidget, editorWidget->getTabLabel().replace("&", "&&"));
+ THEME_TUNER->manageCompactLayout(editorWidget);
editorWidget->installEventFilter(this);
}
@@ -241,6 +251,12 @@ void MultiEditor::focusThisEditor()
w->focusThisWidget();
}
+void MultiEditor::setCornerLabel(const QString &label)
+{
+ cornerLabel->setText(label);
+ cornerLabel->setVisible(!label.isNull());
+}
+
void MultiEditor::loadBuiltInEditors()
{
PLUGINS->loadBuiltInPlugin(new MultiEditorBoolPlugin);
diff --git a/SQLiteStudio3/guiSQLiteStudio/multieditor/multieditor.h b/SQLiteStudio3/guiSQLiteStudio/multieditor/multieditor.h
index 2576c97..04b9af7 100644
--- a/SQLiteStudio3/guiSQLiteStudio/multieditor/multieditor.h
+++ b/SQLiteStudio3/guiSQLiteStudio/multieditor/multieditor.h
@@ -45,6 +45,7 @@ class GUI_API_EXPORT MultiEditor : public QWidget
void setDeletedRow(bool value);
void setDataType(const DataType& dataType);
void focusThisEditor();
+ void setCornerLabel(const QString& label);
static void loadBuiltInEditors();
@@ -61,6 +62,7 @@ class GUI_API_EXPORT MultiEditor : public QWidget
static const int margins = 2;
static const int spacing = 2;
+ QLabel* cornerLabel = nullptr;
QCheckBox* nullCheck = nullptr;
QTabWidget* tabs = nullptr;
QList<MultiEditorWidget*> editors;