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/fontsize"] = 12;
|
||||||
this->defaultmap["editor/syntaxhighlight"] = "For Light Background";
|
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();
|
uint savedsize = getValue("editor/fontsize").toUInt();
|
||||||
QFontDatabase db;
|
QFontDatabase db;
|
||||||
foreach(uint size, db.standardSizes()) {
|
foreach(uint size, db.standardSizes()) {
|
||||||
|
@ -373,6 +379,12 @@ void Preferences::on_forceGoldfeatherBox_toggled(bool state)
|
||||||
emit openCSGSettingsChanged();
|
emit openCSGSettingsChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Preferences::on_mouseWheelZoomBox_toggled(bool state)
|
||||||
|
{
|
||||||
|
QSettings settings;
|
||||||
|
settings.setValue("editor/ctrlmousewheelzoom", state);
|
||||||
|
}
|
||||||
|
|
||||||
void Preferences::keyPressEvent(QKeyEvent *e)
|
void Preferences::keyPressEvent(QKeyEvent *e)
|
||||||
{
|
{
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
|
@ -435,6 +447,8 @@ void Preferences::updateGUI()
|
||||||
int shidx = this->syntaxHighlight->findText(shighlight);
|
int shidx = this->syntaxHighlight->findText(shighlight);
|
||||||
if (shidx >= 0) this->syntaxHighlight->setCurrentIndex(shidx);
|
if (shidx >= 0) this->syntaxHighlight->setCurrentIndex(shidx);
|
||||||
|
|
||||||
|
this->mouseWheelZoomBox->setChecked(getValue("editor/ctrlmousewheelzoom").toBool());
|
||||||
|
|
||||||
if (AutoUpdater *updater = AutoUpdater::updater()) {
|
if (AutoUpdater *updater = AutoUpdater::updater()) {
|
||||||
this->updateCheckBox->setChecked(updater->automaticallyChecksForUpdates());
|
this->updateCheckBox->setChecked(updater->automaticallyChecksForUpdates());
|
||||||
this->snapshotCheckBox->setChecked(updater->enableSnapshots());
|
this->snapshotCheckBox->setChecked(updater->enableSnapshots());
|
||||||
|
|
|
@ -32,6 +32,7 @@ public slots:
|
||||||
void on_polysetCacheSizeEdit_textChanged(const QString &);
|
void on_polysetCacheSizeEdit_textChanged(const QString &);
|
||||||
void on_opencsgLimitEdit_textChanged(const QString &);
|
void on_opencsgLimitEdit_textChanged(const QString &);
|
||||||
void on_forceGoldfeatherBox_toggled(bool);
|
void on_forceGoldfeatherBox_toggled(bool);
|
||||||
|
void on_mouseWheelZoomBox_toggled(bool);
|
||||||
void on_updateCheckBox_toggled(bool);
|
void on_updateCheckBox_toggled(bool);
|
||||||
void on_snapshotCheckBox_toggled(bool);
|
void on_snapshotCheckBox_toggled(bool);
|
||||||
void on_checkNowButton_clicked();
|
void on_checkNowButton_clicked();
|
||||||
|
|
|
@ -165,7 +165,7 @@
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
<layout class="QHBoxLayout" name="syntaxHighlightLayout">
|
||||||
<property name="bottomMargin">
|
<property name="bottomMargin">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
|
@ -182,24 +182,14 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</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>
|
<item>
|
||||||
<widget class="QComboBox" name="syntaxHighlight">
|
<widget class="QComboBox" name="syntaxHighlight">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>For Light Background</string>
|
<string>For Light Background</string>
|
||||||
|
@ -217,6 +207,62 @@
|
||||||
</item>
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</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>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
@ -417,8 +463,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>98</width>
|
<width>803</width>
|
||||||
<height>36</height>
|
<height>325</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_10">
|
<layout class="QVBoxLayout" name="verticalLayout_10">
|
||||||
|
|
|
@ -104,6 +104,11 @@ void Editor::zoomOut()
|
||||||
|
|
||||||
void Editor::wheelEvent ( QWheelEvent * event )
|
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->modifiers() == Qt::ControlModifier) {
|
||||||
if (event->delta() > 0 )
|
if (event->delta() > 0 )
|
||||||
zoomIn();
|
zoomIn();
|
||||||
|
|
Loading…
Reference in New Issue