[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-i18n-doc
Subject: [krita/rempt-opengl-check2] libs/ui: Add an option to allow the toolbox to be smaller than 2 columns
From: Boudewijn Rempt <boud () valdyas ! org>
Date: 2016-05-14 14:49:28
Message-ID: E1b1asi-0008Da-Qu () scm ! kde ! org
[Download RAW message or body]
Git commit 1ae4c023d42b80be139b3b59b720f7ef0b6ab618 by Boudewijn Rempt.
Committed on 14/05/2016 at 13:54.
Pushed by rempt into branch 'rempt-opengl-check2'.
Add an option to allow the toolbox to be smaller than 2 columns
This unfortunately adds a new string, but we cannot get away from
that.
CCMAIL:kde-i18n-doc@kde.org
M +9 -0 libs/ui/dialogs/kis_dlg_preferences.cc
M +1 -0 libs/ui/dialogs/kis_dlg_preferences.h
M +8 -1 libs/ui/forms/wdggeneralsettings.ui
M +12 -0 libs/ui/kis_config.cc
M +3 -0 libs/ui/kis_config.h
M +1 -0 libs/ui/opengl/kis_opengl.cpp
http://commits.kde.org/krita/1ae4c023d42b80be139b3b59b720f7ef0b6ab618
diff --git a/libs/ui/dialogs/kis_dlg_preferences.cc b/libs/ui/dialogs/kis_dlg_preferences.cc
index c989454..4913a7e 100644
--- a/libs/ui/dialogs/kis_dlg_preferences.cc
+++ b/libs/ui/dialogs/kis_dlg_preferences.cc
@@ -120,6 +120,7 @@ GeneralTab::GeneralTab(QWidget *_parent, const char *_name)
m_chkCompressKra->setChecked(cfg.compressKra());
m_radioToolOptionsInDocker->setChecked(cfg.toolOptionsInDocker());
m_chkSwitchSelectionCtrlAlt->setChecked(cfg.switchSelectionCtrlAlt());
+ chkNarrowToolbox->setChecked(cfg.narrowToolbox());
m_chkConvertOnImport->setChecked(cfg.convertToImageColorspaceOnImport());
connect(m_bnFileName, SIGNAL(clicked()), SLOT(getBackgroundImage()));
@@ -149,6 +150,7 @@ void GeneralTab::setDefault()
m_chkCompressKra->setChecked(cfg.compressKra(true));
m_radioToolOptionsInDocker->setChecked(cfg.toolOptionsInDocker(true));
m_chkSwitchSelectionCtrlAlt->setChecked(cfg.switchSelectionCtrlAlt(true));
+ chkNarrowToolbox->setChecked(cfg.narrowToolbox(true));
m_chkConvertOnImport->setChecked(cfg.convertToImageColorspaceOnImport(true));
}
@@ -220,6 +222,12 @@ bool GeneralTab::switchSelectionCtrlAlt()
}
+bool GeneralTab::narrowToolbox()
+{
+ return chkNarrowToolbox->isChecked();
+}
+
+
bool GeneralTab::convertToImageColorspaceOnImport()
{
return m_chkConvertOnImport->isChecked();
@@ -976,6 +984,7 @@ bool KisDlgPreferences::editPreferences()
cfg.setCompressKra(dialog->m_general->compressKra());
cfg.setToolOptionsInDocker(dialog->m_general->toolOptionsInDocker());
cfg.setSwitchSelectionCtrlAlt(dialog->m_general->switchSelectionCtrlAlt());
+ cfg.setNarrowToolbox(dialog->m_general->narrowToolbox());
cfg.setConvertToImageColorspaceOnImport(dialog->m_general->convertToImageColorspaceOnImport());
KisPart *part = KisPart::instance();
diff --git a/libs/ui/dialogs/kis_dlg_preferences.h b/libs/ui/dialogs/kis_dlg_preferences.h
index c4ec62e..77d1809 100644
--- a/libs/ui/dialogs/kis_dlg_preferences.h
+++ b/libs/ui/dialogs/kis_dlg_preferences.h
@@ -79,6 +79,7 @@ public:
bool compressKra();
bool toolOptionsInDocker();
bool switchSelectionCtrlAlt();
+ bool narrowToolbox();
bool convertToImageColorspaceOnImport();
private Q_SLOTS:
void getBackgroundImage();
diff --git a/libs/ui/forms/wdggeneralsettings.ui b/libs/ui/forms/wdggeneralsettings.ui
index 0db86c4..073f743 100644
--- a/libs/ui/forms/wdggeneralsettings.ui
+++ b/libs/ui/forms/wdggeneralsettings.ui
@@ -29,7 +29,7 @@
<item row="0" column="0">
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
- <number>0</number>
+ <number>2</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
@@ -418,6 +418,13 @@
</widget>
</item>
<item>
+ <widget class="QCheckBox" name="chkNarrowToolbox">
+ <property name="text">
+ <string>Make the toolbox one icon column or row</string>
+ </property>
+ </widget>
+ </item>
+ <item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
diff --git a/libs/ui/kis_config.cc b/libs/ui/kis_config.cc
index a3db7f5..f1d637f 100644
--- a/libs/ui/kis_config.cc
+++ b/libs/ui/kis_config.cc
@@ -1664,6 +1664,18 @@ void KisConfig::setSwitchSelectionCtrlAlt(bool value)
KisConfigNotifier::instance()->notifyConfigChanged();
}
+bool KisConfig::narrowToolbox(bool defaultValue) const
+{
+ return defaultValue ? false : m_cfg.readEntry("allowNarrowToolbox", false);
+
+}
+
+void KisConfig::setNarrowToolbox(bool value)
+{
+ m_cfg.writeEntry("allowNarrowToolbox", value);
+}
+
+
bool KisConfig::convertToImageColorspaceOnImport(bool defaultValue) const
{
return defaultValue ? false : m_cfg.readEntry("ConvertToImageColorSpaceOnImport", false);
diff --git a/libs/ui/kis_config.h b/libs/ui/kis_config.h
index 377845c..19e0dd9 100644
--- a/libs/ui/kis_config.h
+++ b/libs/ui/kis_config.h
@@ -468,6 +468,9 @@ public:
bool switchSelectionCtrlAlt(bool defaultValue = false) const;
void setSwitchSelectionCtrlAlt(bool value);
+ bool narrowToolbox(bool defaultValue = false) const;
+ void setNarrowToolbox(bool value);
+
bool convertToImageColorspaceOnImport(bool defaultValue = false) const;
void setConvertToImageColorspaceOnImport(bool value);
diff --git a/libs/ui/opengl/kis_opengl.cpp b/libs/ui/opengl/kis_opengl.cpp
index 2f75b7c..303c67d 100644
--- a/libs/ui/opengl/kis_opengl.cpp
+++ b/libs/ui/opengl/kis_opengl.cpp
@@ -67,6 +67,7 @@ public:
// 3.2 Core
format.setProfile( QSurfaceFormat::CompatibilityProfile );
+ format.setOptions(QSurfaceFormat::DeprecatedFunctions);
setFormat( format );
// Create an OpenGL context
context = new QOpenGLContext;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic