mirror of https://github.com/vitalif/openscad
commit
0e9d06669e
|
@ -65,6 +65,12 @@ Preferences::Preferences(QWidget *parent) : QMainWindow(parent)
|
|||
this->defaultmap["editor/fontsize"] = 12;
|
||||
this->defaultmap["editor/syntaxhighlight"] = "For Light Background";
|
||||
|
||||
#if defined (Q_OS_MAC)
|
||||
this->defaultmap["editor/ctrlmousewheelzoom"] = false;
|
||||
#else
|
||||
this->defaultmap["editor/ctrlmousewheelzoom"] = true;
|
||||
#endif
|
||||
|
||||
uint savedsize = getValue("editor/fontsize").toUInt();
|
||||
QFontDatabase db;
|
||||
foreach(uint size, db.standardSizes()) {
|
||||
|
@ -373,6 +379,12 @@ void Preferences::on_forceGoldfeatherBox_toggled(bool state)
|
|||
emit openCSGSettingsChanged();
|
||||
}
|
||||
|
||||
void Preferences::on_mouseWheelZoomBox_toggled(bool state)
|
||||
{
|
||||
QSettings settings;
|
||||
settings.setValue("editor/ctrlmousewheelzoom", state);
|
||||
}
|
||||
|
||||
void Preferences::keyPressEvent(QKeyEvent *e)
|
||||
{
|
||||
#ifdef Q_OS_MAC
|
||||
|
@ -435,6 +447,8 @@ void Preferences::updateGUI()
|
|||
int shidx = this->syntaxHighlight->findText(shighlight);
|
||||
if (shidx >= 0) this->syntaxHighlight->setCurrentIndex(shidx);
|
||||
|
||||
this->mouseWheelZoomBox->setChecked(getValue("editor/ctrlmousewheelzoom").toBool());
|
||||
|
||||
if (AutoUpdater *updater = AutoUpdater::updater()) {
|
||||
this->updateCheckBox->setChecked(updater->automaticallyChecksForUpdates());
|
||||
this->snapshotCheckBox->setChecked(updater->enableSnapshots());
|
||||
|
|
|
@ -32,6 +32,7 @@ public slots:
|
|||
void on_polysetCacheSizeEdit_textChanged(const QString &);
|
||||
void on_opencsgLimitEdit_textChanged(const QString &);
|
||||
void on_forceGoldfeatherBox_toggled(bool);
|
||||
void on_mouseWheelZoomBox_toggled(bool);
|
||||
void on_updateCheckBox_toggled(bool);
|
||||
void on_snapshotCheckBox_toggled(bool);
|
||||
void on_checkNowButton_clicked();
|
||||
|
|
|
@ -165,7 +165,7 @@
|
|||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<layout class="QHBoxLayout" name="syntaxHighlightLayout">
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
|
@ -182,24 +182,14 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Maximum</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>30</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="syntaxHighlight">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>For Light Background</string>
|
||||
|
@ -217,6 +207,62 @@
|
|||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>30</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="mouseWheelZoomLayout">
|
||||
<property name="topMargin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_11">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Use Ctrl/Cmd-Mouse-wheel to zoom text</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="mouseWheelZoomBox">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_6">
|
||||
<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>
|
||||
|
@ -417,8 +463,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>98</width>
|
||||
<height>36</height>
|
||||
<width>803</width>
|
||||
<height>325</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_10">
|
||||
|
|
|
@ -104,6 +104,11 @@ void Editor::zoomOut()
|
|||
|
||||
void Editor::wheelEvent ( QWheelEvent * event )
|
||||
{
|
||||
QSettings settings;
|
||||
if (!Preferences::inst()->getValue("editor/ctrlmousewheelzoom").toBool()) {
|
||||
return;
|
||||
// see numerous bug reports on mailing list
|
||||
}
|
||||
if (event->modifiers() == Qt::ControlModifier) {
|
||||
if (event->delta() > 0 )
|
||||
zoomIn();
|
||||
|
|
Loading…
Reference in New Issue