Skip to content

Commit

Permalink
added size Settings
Browse files Browse the repository at this point in the history
  • Loading branch information
8-Lambda-8 committed Dec 18, 2023
1 parent 4124406 commit 5c55d14
Show file tree
Hide file tree
Showing 2 changed files with 156 additions and 67 deletions.
15 changes: 12 additions & 3 deletions ui/src/functionwizard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,8 @@ VCWidget *FunctionWizard::createWidget(int type, VCWidget *parent, int xpos, int
cuelist->move(QPoint(xpos, ypos));
if (func != NULL)
cuelist->setChaser(func->id());
cuelist->resize(QSize(300, m_sliderHeightSpin->value()));

widget = cuelist;
}
break;
Expand Down Expand Up @@ -803,6 +805,8 @@ VCWidget *FunctionWizard::createWidget(int type, VCWidget *parent, int xpos, int
slider->setSliderMode(VCSlider::Level);
}

slider->resize(QSize(m_sliderWidthSpin->value(), m_sliderHeightSpin->value()));

widget = slider;
}
break;
Expand All @@ -820,6 +824,7 @@ VCWidget *FunctionWizard::createWidget(int type, VCWidget *parent, int xpos, int
fxi.setHead(GroupHead(fxID,0));
XYPad->appendFixture(fxi);
}
XYPad->resize(QSize(m_sliderHeightSpin->value(), m_sliderHeightSpin->value()));

widget = XYPad;
}
Expand Down Expand Up @@ -903,9 +908,13 @@ QSize FunctionWizard::recursiveCreateWidget(QTreeWidgetItem *item, VCWidget *par
else
childWidget->setCaption(childItem->text(KWidgetName));

QTextStream cout(stdout, QIODevice::WriteOnly);
cout << childItem->text(KWidgetName) << Qt::endl;
//cout << "p:"<<parent->type() << " spin:" << m_lineCntSpin->value() << " per:" <<wPerLine << Qt::endl;

if (childItem->childCount() > 0)
{
childWidget->resize(QSize(1000, 1000));
childWidget->resize(QSize(2000, 1000));

QSize size = recursiveCreateWidget(childItem, childWidget, type);

Expand All @@ -918,8 +927,8 @@ QSize FunctionWizard::recursiveCreateWidget(QTreeWidgetItem *item, VCWidget *par
if (subY + childWidget->height() > groupSize.height())
groupSize.setHeight(subY + childWidget->height() + 10);


if (c > 0 && (c + 1)%4 == 0)
int wPerLine = parent->type()==VCWidget::SoloFrameWidget ? 4 : m_lineCntSpin->value();
if (c > 0 && (c + 1)%wPerLine == 0)
{
subX = 10;
subY += childWidget->height() + 10;
Expand Down
208 changes: 144 additions & 64 deletions ui/src/functionwizard.ui
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@

Copyright (c) 2015 Massimo Callegari

Licensed under the Apache License, Version 2.0 (the "License");
Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0.txt

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Expand All @@ -33,68 +33,6 @@
<string>Function Wizard</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="2" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="m_nextButton">
<property name="layoutDirection">
<enum>Qt::RightToLeft</enum>
</property>
<property name="text">
<string>Next</string>
</property>
<property name="icon">
<iconset resource="qlcui.qrc">
<normaloff>:/forward.png</normaloff>:/forward.png</iconset>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="m_okButton">
<property name="text">
<string>OK</string>
</property>
<property name="icon">
<iconset resource="qlcui.qrc">
<normaloff>:/check.png</normaloff>:/check.png</iconset>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="m_cancelButton">
<property name="text">
<string>Cancel</string>
</property>
<property name="icon">
<iconset resource="qlcui.qrc">
<normaloff>:/uncheck.png</normaloff>:/uncheck.png</iconset>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="0">
<widget class="QTabWidget" name="m_tabWidget">
<property name="currentIndex">
Expand Down Expand Up @@ -342,6 +280,86 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item>
<layout class="QGridLayout" name="options">
<item row="1" column="0">
<widget class="QSpinBox" name="m_sliderHeightSpin">
<property name="minimum">
<number>100</number>
</property>
<property name="maximum">
<number>9999</number>
</property>
<property name="value">
<number>250</number>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="m_sliderWidthSpin">
<property name="minimum">
<number>20</number>
</property>
<property name="maximum">
<number>9999</number>
</property>
<property name="value">
<number>70</number>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="labelWidth">
<property name="text">
<string>Slider Width</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="labelHeight">
<property name="text">
<string>Slider Height</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QSpinBox" name="m_lineCntSpin">
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>50</number>
</property>
<property name="value">
<number>10</number>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLabel" name="labelCnt">
<property name="text">
<string>Widgets/Line</string>
</property>
</widget>
</item>
<item row="0" column="3">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Ignored</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QTreeWidget" name="m_widgetsTree">
<column>
Expand All @@ -355,6 +373,68 @@ p, li { white-space: pre-wrap; }
</widget>
</widget>
</item>
<item row="2" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="m_nextButton">
<property name="layoutDirection">
<enum>Qt::RightToLeft</enum>
</property>
<property name="text">
<string>Next</string>
</property>
<property name="icon">
<iconset resource="qlcui.qrc">
<normaloff>:/forward.png</normaloff>:/forward.png</iconset>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="m_okButton">
<property name="text">
<string>OK</string>
</property>
<property name="icon">
<iconset resource="qlcui.qrc">
<normaloff>:/check.png</normaloff>:/check.png</iconset>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="m_cancelButton">
<property name="text">
<string>Cancel</string>
</property>
<property name="icon">
<iconset resource="qlcui.qrc">
<normaloff>:/uncheck.png</normaloff>:/uncheck.png</iconset>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources>
Expand Down

0 comments on commit 5c55d14

Please sign in to comment.