Commit 6bba174c authored by Scott Petrovic's avatar Scott Petrovic

condense OpenGL settings box. Be more explicit with enabled and checked status

parent fe98c3e9
......@@ -457,14 +457,16 @@ DisplaySettingsTab::DisplaySettingsTab(QWidget *parent, const char *name)
KisConfig cfg;
#ifdef HAVE_OPENGL
if (!QGLFormat::hasOpenGL()) {
cbUseOpenGL->setEnabled(false);
if (!QGLFormat::hasOpenGL()) {
grpOpenGL->setEnabled(false);
grpOpenGL->setChecked(false);
chkUseTextureBuffer->setEnabled(false);
chkDisableDoubleBuffering->setEnabled(false);
chkDisableVsync->setEnabled(false);
cmbFilterMode->setEnabled(false);
} else {
cbUseOpenGL->setChecked(cfg.useOpenGL());
grpOpenGL->setEnabled(true);
grpOpenGL->setChecked(cfg.useOpenGL());
chkUseTextureBuffer->setEnabled(cfg.useOpenGL());
chkUseTextureBuffer->setChecked(cfg.useOpenGLTextureBuffer());
chkDisableDoubleBuffering->setVisible(cfg.showAdvancedOpenGLSettings());
......@@ -481,11 +483,12 @@ DisplaySettingsTab::DisplaySettingsTab(QWidget *parent, const char *name)
}
}
if (qApp->applicationName() == "kritasketch" || qApp->applicationName() == "kritagemini") {
cbUseOpenGL->setVisible(false);
cbUseOpenGL->setMaximumHeight(0);
grpOpenGL->setVisible(false);
grpOpenGL->setMaximumHeight(0);
}
#else
grpOpenGL->setEnabled(false);
grpOpenGL->setChecked(false);
#endif
KoColor c;
......@@ -507,12 +510,12 @@ DisplaySettingsTab::DisplaySettingsTab(QWidget *parent, const char *name)
chkSelectionOutlineAntialiasing->setChecked(cfg.antialiasSelectionOutline());
chkChannelsAsColor->setChecked(cfg.showSingleChannelAsColor());
connect(cbUseOpenGL, SIGNAL(toggled(bool)), SLOT(slotUseOpenGLToggled(bool)));
connect(grpOpenGL, SIGNAL(toggled(bool)), SLOT(slotUseOpenGLToggled(bool)));
}
void DisplaySettingsTab::setDefault()
{
cbUseOpenGL->setChecked(true);
grpOpenGL->setChecked(true);
chkUseTextureBuffer->setChecked(false);
chkUseTextureBuffer->setEnabled(true);
chkDisableDoubleBuffering->setEnabled(true);
......@@ -849,9 +852,9 @@ bool KisDlgPreferences::editPreferences()
#endif
#ifdef HAVE_OPENGL
if (!cfg.useOpenGL() && dialog->m_displaySettings->cbUseOpenGL->isChecked())
if (!cfg.useOpenGL() && dialog->m_displaySettings->grpOpenGL->isChecked())
cfg.setCanvasState("TRY_OPENGL");
cfg.setUseOpenGL(dialog->m_displaySettings->cbUseOpenGL->isChecked());
cfg.setUseOpenGL(dialog->m_displaySettings->grpOpenGL->isChecked());
cfg.setUseOpenGLTextureBuffer(dialog->m_displaySettings->chkUseTextureBuffer->isChecked());
cfg.setOpenGLFilteringMode(dialog->m_displaySettings->cmbFilterMode->currentIndex());
cfg.setDisableDoubleBuffering(dialog->m_displaySettings->chkDisableDoubleBuffering->isChecked());
......
......@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>497</width>
<width>504</width>
<height>643</height>
</rect>
</property>
......@@ -164,8 +164,11 @@
<property name="title">
<string>OpenGL</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<layout class="QGridLayout">
<item row="3" column="0">
<item row="2" column="0">
<widget class="QCheckBox" name="chkDisableDoubleBuffering">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Try to disable double buffering. This makes painting more responsive, but might cause crashes with some ATI GPU/driver combinations.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
......@@ -178,7 +181,7 @@
</property>
</widget>
</item>
<item row="6" column="0">
<item row="5" column="0">
<widget class="QComboBox" name="cmbFilterMode">
<property name="currentIndex">
<number>0</number>
......@@ -205,43 +208,33 @@
</item>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="chkUseTextureBuffer">
<item row="3" column="0">
<widget class="QCheckBox" name="chkDisableVsync">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Use Texture Buffering. This can be faster on some GPU/Driver combinations (like Intel) or broken on some others (like AMD/Radeon).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Use Texture Buffer</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Try to disable vsync for Krita. This makes painting more responsive. Uncheck only when experiencing crashes with some GPU/driver combinations.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="cbUseOpenGL">
<property name="text">
<string>Enable OpenGL</string>
<string>Disable vsync (needs restart)</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="5" column="0">
<item row="4" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Scaling Mode:</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QCheckBox" name="chkDisableVsync">
<item row="1" column="0">
<widget class="QCheckBox" name="chkUseTextureBuffer">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Try to disable vsync for Krita. This makes painting more responsive. Uncheck only when experiencing crashes with some GPU/driver combinations.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Use Texture Buffering. This can be faster on some GPU/Driver combinations (like Intel) or broken on some others (like AMD/Radeon).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Disable vsync (needs restart)</string>
</property>
<property name="checked">
<bool>true</bool>
<string>Use Texture Buffer</string>
</property>
</widget>
</item>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment