mirror of https://github.com/vitalif/openscad
Make welcome screen resizable and update some minor UI issues.
- Move images to icons folder - Move "Show welcome screen" to advanced tab in preferences - Set button styles via Qt stylesheet to handle hover and disable - Rename config setting to "launcher/showOnStartup" and add defaultmaster
parent
e7d3025753
commit
8c892907c2
BIN
background.png
BIN
background.png
Binary file not shown.
Before Width: | Height: | Size: 313 KiB |
|
@ -0,0 +1,98 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
id="svg2"
|
||||
version="1.1"
|
||||
inkscape:version="0.48.5 r10040"
|
||||
sodipodi:docname="background.png"
|
||||
width="4096"
|
||||
height="2048">
|
||||
<defs
|
||||
id="defs4">
|
||||
<linearGradient
|
||||
id="linearGradient3866">
|
||||
<stop
|
||||
style="stop-color:#eeeeee;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3868" />
|
||||
<stop
|
||||
style="stop-color:#fafafa;stop-opacity:0.98039216;"
|
||||
offset="1"
|
||||
id="stop3870" />
|
||||
</linearGradient>
|
||||
<inkscape:path-effect
|
||||
effect="spiro"
|
||||
id="path-effect3864"
|
||||
is_visible="true" />
|
||||
<inkscape:path-effect
|
||||
effect="spiro"
|
||||
id="path-effect3092"
|
||||
is_visible="true" />
|
||||
<inkscape:path-effect
|
||||
effect="spiro"
|
||||
id="path-effect3088"
|
||||
is_visible="true" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3866"
|
||||
id="linearGradient3872"
|
||||
x1="498.51535"
|
||||
y1="-132.61803"
|
||||
x2="485.61191"
|
||||
y2="1079.5651"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
spreadMethod="pad"
|
||||
gradientTransform="matrix(1.6433895,0,0,1.7222108,0,-757.44619)" />
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#fcfcfc"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="1"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="0.27395613"
|
||||
inkscape:cx="821.95355"
|
||||
inkscape:cy="1254.6882"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:window-width="2085"
|
||||
inkscape:window-height="944"
|
||||
inkscape:window-x="41"
|
||||
inkscape:window-y="426"
|
||||
inkscape:window-maximized="0" />
|
||||
<metadata
|
||||
id="metadata7">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(0,995.63782)">
|
||||
<path
|
||||
style="fill:url(#linearGradient3872);fill-opacity:1;fill-rule:nonzero;stroke:none"
|
||||
d="m 0,-607.63782 c 573.64466,-587.12628 1686.5916,-78.13811 4095,1318.13894 l 0,341.86108 -4095,0 z"
|
||||
id="path3090"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccccc" />
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.9 KiB |
Binary file not shown.
After Width: | Height: | Size: 50 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
25
openscad.qrc
25
openscad.qrc
|
@ -1,14 +1,15 @@
|
|||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file>icons/prefsFeatures.png</file>
|
||||
<file>icons/stopbutton.png</file>
|
||||
<file>icons/prefsAdvanced.png</file>
|
||||
<file>icons/prefs3DView.png</file>
|
||||
<file>icons/prefsEditor.png</file>
|
||||
<file>icons/prefsUpdate.png</file>
|
||||
<file>icons/flattr.png</file>
|
||||
<file>src/AboutDialog.html</file>
|
||||
<file>background.png</file>
|
||||
<file>button.png</file>
|
||||
</qresource>
|
||||
<qresource prefix="/">
|
||||
<file>icons/button.png</file>
|
||||
<file>icons/background-welcome-screen.svg</file>
|
||||
<file>icons/prefsFeatures.png</file>
|
||||
<file>icons/stopbutton.png</file>
|
||||
<file>icons/prefsAdvanced.png</file>
|
||||
<file>icons/prefs3DView.png</file>
|
||||
<file>icons/prefsEditor.png</file>
|
||||
<file>icons/prefsUpdate.png</file>
|
||||
<file>icons/flattr.png</file>
|
||||
<file>src/AboutDialog.html</file>
|
||||
<file>icons/background.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
|
@ -98,7 +98,7 @@ private slots:
|
|||
void openCurrentExample();
|
||||
void enableRecentButton(QListWidgetItem*);
|
||||
void enableExampleButton(QTreeWidgetItem*, int);
|
||||
void checkboxState(int);
|
||||
void checkboxState(bool);
|
||||
private:
|
||||
void openFile(const QString &filename);
|
||||
void handleFileDrop(const QString &filename);
|
||||
|
|
|
@ -103,6 +103,7 @@ Preferences::Preferences(QWidget *parent) : QMainWindow(parent)
|
|||
this->defaultmap["advanced/forceGoldfeather"] = false;
|
||||
this->defaultmap["advanced/mdi"] = true;
|
||||
this->defaultmap["advanced/undockableWindows"] = false;
|
||||
this->defaultmap["launcher/showOnStartup"] = true;
|
||||
|
||||
// Toolbar
|
||||
QActionGroup *group = new QActionGroup(this);
|
||||
|
@ -137,8 +138,6 @@ Preferences::Preferences(QWidget *parent) : QMainWindow(parent)
|
|||
|
||||
setupFeaturesPage();
|
||||
updateGUI();
|
||||
|
||||
connect(this->launcherBox, SIGNAL(stateChanged(int)), SLOT(launcherSettings(int)));
|
||||
}
|
||||
|
||||
Preferences::~Preferences()
|
||||
|
@ -157,14 +156,6 @@ Preferences::~Preferences()
|
|||
* @param widget The widget that should be shown when the action is triggered.
|
||||
* This must be a child page of the stackedWidget.
|
||||
*/
|
||||
|
||||
void
|
||||
Preferences::launcherSettings(int state)
|
||||
{
|
||||
QSettings settings;
|
||||
settings.setValue("launcher/checkboxState", state);
|
||||
}
|
||||
|
||||
void
|
||||
Preferences::addPrefPage(QActionGroup *group, QAction *action, QWidget *widget)
|
||||
{
|
||||
|
@ -388,6 +379,13 @@ void Preferences::on_mouseWheelZoomBox_toggled(bool state)
|
|||
settings.setValue("editor/ctrlmousewheelzoom", state);
|
||||
}
|
||||
|
||||
void
|
||||
Preferences::on_launcherBox_toggled(bool state)
|
||||
{
|
||||
QSettings settings;
|
||||
settings.setValue("launcher/showOnStartup", state);
|
||||
}
|
||||
|
||||
void Preferences::keyPressEvent(QKeyEvent *e)
|
||||
{
|
||||
#ifdef Q_OS_MAC
|
||||
|
@ -470,6 +468,7 @@ void Preferences::updateGUI()
|
|||
this->forceGoldfeatherBox->setChecked(getValue("advanced/forceGoldfeather").toBool());
|
||||
this->mdiCheckBox->setChecked(getValue("advanced/mdi").toBool());
|
||||
this->undockCheckBox->setChecked(getValue("advanced/undockableWindows").toBool());
|
||||
this->launcherBox->setChecked(getValue("launcher/showOnStartup").toBool());
|
||||
}
|
||||
|
||||
void Preferences::apply() const
|
||||
|
|
|
@ -35,7 +35,7 @@ public slots:
|
|||
void on_mdiCheckBox_toggled(bool);
|
||||
void on_undockCheckBox_toggled(bool);
|
||||
void on_checkNowButton_clicked();
|
||||
void launcherSettings(int);
|
||||
void on_launcherBox_toggled(bool);
|
||||
void on_editorType_editTextChanged(const QString &);
|
||||
|
||||
signals:
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>544</width>
|
||||
<height>389</height>
|
||||
<width>852</width>
|
||||
<height>550</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
|
@ -27,7 +27,7 @@
|
|||
<item>
|
||||
<widget class="QStackedWidget" name="stackedWidget">
|
||||
<property name="currentIndex">
|
||||
<number>2</number>
|
||||
<number>3</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="page3DView">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
|
@ -210,7 +210,7 @@
|
|||
<widget class="QFontComboBox" name="fontChooser">
|
||||
<property name="currentFont">
|
||||
<font>
|
||||
<family>Helvetica</family>
|
||||
<family>Nimbus Sans L</family>
|
||||
<pointsize>12</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
|
@ -510,16 +510,7 @@
|
|||
</widget>
|
||||
<widget class="QWidget" name="pageFeatures">
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
|
@ -556,8 +547,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>518</width>
|
||||
<height>278</height>
|
||||
<width>832</width>
|
||||
<height>420</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_10">
|
||||
|
@ -568,13 +559,6 @@
|
|||
</property>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="launcherBox">
|
||||
<property name="text">
|
||||
<string>Show Launcher.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_3">
|
||||
<property name="orientation">
|
||||
|
@ -694,19 +678,6 @@
|
|||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>11</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="mdiCheckBox">
|
||||
<property name="text">
|
||||
|
@ -721,6 +692,26 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="launcherBox">
|
||||
<property name="text">
|
||||
<string>Show Welcome Screen</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>11</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
|
|
|
@ -6,44 +6,8 @@ LaunchingScreen::LaunchingScreen(QWidget *parent) :
|
|||
ui(new Ui::LaunchingScreen)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
this->setStyleSheet("QDialog {background-image:url(':/background.png')}"
|
||||
this->setStyleSheet("QDialog {background-image:url(':/icons/background.png')}"
|
||||
"QPushButton {color:white;}");
|
||||
QPixmap pixmap(":/button.png");
|
||||
QPalette palette;
|
||||
|
||||
palette.setBrush(ui->pushButtonNew->backgroundRole(), QBrush(pixmap));
|
||||
|
||||
palette.setBrush(ui->pushButtonOpen->backgroundRole(), QBrush(pixmap));
|
||||
|
||||
palette.setBrush(ui->pushButtonHelp->backgroundRole(), QBrush(pixmap));
|
||||
|
||||
palette.setBrush(ui->openRecentButton->backgroundRole(), QBrush(pixmap));
|
||||
|
||||
palette.setBrush(ui->openExampleButton->backgroundRole(), QBrush(pixmap));
|
||||
|
||||
ui->pushButtonNew->setFlat(true);
|
||||
ui->pushButtonNew->setAutoFillBackground(true);
|
||||
ui->pushButtonNew->setPalette(palette);
|
||||
|
||||
ui->pushButtonOpen->setFlat(true);
|
||||
ui->pushButtonOpen->setAutoFillBackground(true);
|
||||
ui->pushButtonOpen->setPalette(palette);
|
||||
|
||||
ui->pushButtonHelp->setFlat(true);
|
||||
ui->pushButtonHelp->setAutoFillBackground(true);
|
||||
ui->pushButtonHelp->setPalette(palette);
|
||||
|
||||
ui->openRecentButton->setFlat(true);
|
||||
ui->openRecentButton->setAutoFillBackground(true);
|
||||
ui->openRecentButton->setPalette(palette);
|
||||
|
||||
ui->openExampleButton->setFlat(true);
|
||||
ui->openExampleButton->setAutoFillBackground(true);
|
||||
ui->openExampleButton->setPalette(palette);
|
||||
|
||||
|
||||
// ui->treeWidget->setFrameShape(QFrame::NoFrame);
|
||||
//ui->treeWidget->headerItem()->setForeground(0, Qt::green);
|
||||
}
|
||||
|
||||
LaunchingScreen::~LaunchingScreen()
|
||||
|
|
|
@ -6,169 +6,334 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>676</width>
|
||||
<height>414</height>
|
||||
<width>618</width>
|
||||
<height>516</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
<string>Welcome to OpenSCAD</string>
|
||||
</property>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>50</x>
|
||||
<y>30</y>
|
||||
<width>67</width>
|
||||
<height>61</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../openscad.qrc">:/icons/prefs3DView.png</pixmap>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QCheckBox" name="checkBox">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>460</x>
|
||||
<y>370</y>
|
||||
<width>171</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Show this everytime</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>130</x>
|
||||
<y>26</y>
|
||||
<width>161</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><html><head/><body><p><span style=" font-size:22pt; color:#006100;"> Open</span><span style=" font-size:22pt;">SCAD</span></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>136</x>
|
||||
<y>60</y>
|
||||
<width>261</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>The programmer's 3D CAD Modeller</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QWidget" name="layoutWidget1">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>50</x>
|
||||
<y>110</y>
|
||||
<width>273</width>
|
||||
<height>251</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButtonNew">
|
||||
<property name="text">
|
||||
<string>New</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButtonOpen">
|
||||
<property name="text">
|
||||
<string>Open</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButtonHelp">
|
||||
<property name="text">
|
||||
<string>Help</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Recents</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QListWidget" name="RecentList"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="openRecentButton">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Open Recent</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="layoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>370</x>
|
||||
<y>140</y>
|
||||
<width>258</width>
|
||||
<height>221</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QTreeWidget" name="treeWidget">
|
||||
<column>
|
||||
<property name="windowIcon">
|
||||
<iconset resource="../openscad.qrc">
|
||||
<normaloff>:/icons/prefs3DView.png</normaloff>:/icons/prefs3DView.png</iconset>
|
||||
</property>
|
||||
<property name="sizeGripEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="6" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<property name="leftMargin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>20</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>20</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButtonNew">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QPushButton {
|
||||
margin: 0;
|
||||
padding: 4px;
|
||||
color: white;
|
||||
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #82dd97, stop: 1 #2a833f);
|
||||
border-radius: 2px;
|
||||
}
|
||||
QPushButton:hover {
|
||||
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #92eda7, stop: 1 #3a934f);
|
||||
}
|
||||
QPushButton:disabled {
|
||||
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #dfdfdf, stop: 1 #aeaeae);
|
||||
}
|
||||
QPushButton:pressed {
|
||||
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #2a833f, stop: 1 #82dd97);
|
||||
}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>New</string>
|
||||
</property>
|
||||
<property name="default">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButtonOpen">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QPushButton {
|
||||
margin: 0;
|
||||
padding: 4px;
|
||||
color: white;
|
||||
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #82dd97, stop: 1 #2a833f);
|
||||
border-radius: 2px;
|
||||
}
|
||||
QPushButton:hover {
|
||||
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #92eda7, stop: 1 #3a934f);
|
||||
}
|
||||
QPushButton:disabled {
|
||||
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #dfdfdf, stop: 1 #aeaeae);
|
||||
}
|
||||
QPushButton:pressed {
|
||||
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #2a833f, stop: 1 #82dd97);
|
||||
}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Open</string>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButtonHelp">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QPushButton {
|
||||
margin: 0;
|
||||
padding: 4px;
|
||||
color: white;
|
||||
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #82dd97, stop: 1 #2a833f);
|
||||
border-radius: 2px;
|
||||
}
|
||||
QPushButton:hover {
|
||||
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #92eda7, stop: 1 #3a934f);
|
||||
}
|
||||
QPushButton:disabled {
|
||||
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #dfdfdf, stop: 1 #aeaeae);
|
||||
}
|
||||
QPushButton:pressed {
|
||||
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #2a833f, stop: 1 #82dd97);
|
||||
}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Help</string>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Recents</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QListWidget" name="RecentList">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color:transparent;</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="openRecentButton">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QPushButton {
|
||||
margin: 0;
|
||||
padding: 4px;
|
||||
color: white;
|
||||
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #82dd97, stop: 1 #2a833f);
|
||||
border-radius: 2px;
|
||||
}
|
||||
QPushButton:hover {
|
||||
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #92eda7, stop: 1 #3a934f);
|
||||
}
|
||||
QPushButton:disabled {
|
||||
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #dfdfdf, stop: 1 #aeaeae);
|
||||
}
|
||||
QPushButton:pressed {
|
||||
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #2a833f, stop: 1 #82dd97);
|
||||
}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Open Recent</string>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<property name="leftMargin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>20</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>20</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Examples</string>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="openExampleButton">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Open Example</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTreeWidget" name="treeWidget">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color:transparent;</string>
|
||||
</property>
|
||||
<attribute name="headerVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Examples</string>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="openExampleButton">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QPushButton {
|
||||
margin: 0;
|
||||
padding: 4px;
|
||||
color: white;
|
||||
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #82dd97, stop: 1 #2a833f);
|
||||
border-radius: 2px;
|
||||
}
|
||||
QPushButton:hover {
|
||||
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #92eda7, stop: 1 #3a934f);
|
||||
}
|
||||
QPushButton:disabled {
|
||||
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #dfdfdf, stop: 1 #aeaeae);
|
||||
}
|
||||
QPushButton:pressed {
|
||||
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #2a833f, stop: 1 #82dd97);
|
||||
}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Open Example</string>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="3" column="0" rowspan="2" colspan="2">
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<property name="leftMargin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<item row="0" column="0" rowspan="2">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../openscad.qrc">:/icons/prefs3DView.png</pixmap>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>12</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><html><head/><body><p><span style=" font-size:12pt;">The programmer's 3D CAD Modeller</span></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="1" colspan="2">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><html><head/><body><p><span style=" font-size:22pt; color:#006100;">Open</span><span style=" font-size:22pt;">SCAD</span></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="8" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="checkBox">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>600</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Don't show again</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../openscad.qrc"/>
|
||||
|
|
|
@ -261,7 +261,6 @@ MainWindow::MainWindow(const QString &filename)
|
|||
|
||||
// Launch Screen
|
||||
launcher = new LaunchingScreen(this);
|
||||
launcher->setFixedSize(676,414);
|
||||
connect(launcher->ui->pushButtonNew, SIGNAL(clicked()), this, SLOT(actionNew()));
|
||||
connect(launcher->ui->pushButtonOpen, SIGNAL(clicked()), this, SLOT(actionOpen()));
|
||||
connect(launcher->ui->pushButtonHelp, SIGNAL(clicked()), this, SLOT(helpManual()));
|
||||
|
@ -271,7 +270,7 @@ MainWindow::MainWindow(const QString &filename)
|
|||
this, SLOT(enableExampleButton(QTreeWidgetItem *,int)));
|
||||
connect(launcher->ui->openRecentButton, SIGNAL(clicked()), this, SLOT(launcherOpenRecent()));
|
||||
connect(launcher->ui->openExampleButton, SIGNAL(clicked()), this, SLOT(openCurrentExample()));
|
||||
connect(launcher->ui->checkBox, SIGNAL(stateChanged(int)), this, SLOT(checkboxState(int)));
|
||||
connect(launcher->ui->checkBox, SIGNAL(toggled(bool)), this, SLOT(checkboxState(bool)));
|
||||
|
||||
// Application menu
|
||||
#ifdef DEBUG
|
||||
|
@ -1079,17 +1078,14 @@ void MainWindow::actionOpenRecent()
|
|||
|
||||
void MainWindow::enableRecentButton(QListWidgetItem *itemClicked)
|
||||
{
|
||||
if (itemClicked) {
|
||||
launcher->ui->openRecentButton->setEnabled(true);
|
||||
}
|
||||
const bool enable = itemClicked;
|
||||
launcher->ui->openRecentButton->setEnabled(enable);
|
||||
}
|
||||
|
||||
void MainWindow::enableExampleButton(QTreeWidgetItem *itemClicked, int column)
|
||||
void MainWindow::enableExampleButton(QTreeWidgetItem *itemClicked, int /* column */)
|
||||
{
|
||||
column = 0;
|
||||
if (itemClicked) {
|
||||
launcher->ui->openExampleButton->setEnabled(true);
|
||||
}
|
||||
const bool enable = itemClicked && (itemClicked->childCount() == 0);
|
||||
launcher->ui->openExampleButton->setEnabled(enable);
|
||||
}
|
||||
|
||||
void MainWindow::clearRecentFiles()
|
||||
|
@ -1149,10 +1145,10 @@ void MainWindow::openCurrentExample()
|
|||
launcher->hide();
|
||||
}
|
||||
|
||||
void MainWindow::checkboxState(int state)
|
||||
void MainWindow::checkboxState(bool state)
|
||||
{
|
||||
QSettings settings;
|
||||
settings.setValue("launcher/checkboxState", state);
|
||||
settings.setValue("launcher/showOnStartup", !state);
|
||||
}
|
||||
|
||||
void MainWindow::show_examples()
|
||||
|
|
|
@ -586,7 +586,7 @@ int gui(vector<string> &inputFiles, const fs::path &original_path, int argc, cha
|
|||
mainwin = new MainWindow(assemblePath(original_path, inputFiles[0]));
|
||||
#endif
|
||||
QSettings settings;
|
||||
if (noInputFiles && settings.value("launcher/checkboxState").toInt()) mainwin->launcher->show();
|
||||
if (noInputFiles && settings.value("launcher/showOnStartup").toBool()) mainwin->launcher->show();
|
||||
|
||||
app.connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit()));
|
||||
int rc = app.exec();
|
||||
|
|
Loading…
Reference in New Issue