Resize button. Resizes mode specific color lists. Partial implementation of resizing zones
This commit is contained in:
parent
d7298cafd0
commit
736e624366
9 changed files with 458 additions and 204 deletions
|
|
@ -72,6 +72,7 @@ SOURCES += \
|
|||
qt/OpenRGBProfileSaveDialog.cpp \
|
||||
qt/OpenRGBSoftwareInfoPage.cpp \
|
||||
qt/OpenRGBSystemInfoPage.cpp \
|
||||
qt/OpenRGBZoneResizeDialog.cpp \
|
||||
qt/hsv.cpp \
|
||||
serial_port/serial_port.cpp \
|
||||
super_io/super_io.cpp \
|
||||
|
|
@ -161,6 +162,7 @@ HEADERS += \
|
|||
qt/OpenRGBProfileSaveDialog.h \
|
||||
qt/OpenRGBSoftwareInfoPage.h \
|
||||
qt/OpenRGBSystemInfoPage.h \
|
||||
qt/OpenRGBZoneResizeDialog.h \
|
||||
serial_port/find_usb_serial_port.h \
|
||||
serial_port/serial_port.h \
|
||||
super_io/super_io.h \
|
||||
|
|
@ -223,7 +225,8 @@ FORMS += \
|
|||
qt/OpenRGBDialog2.ui \
|
||||
qt/OpenRGBProfileSaveDialog.ui \
|
||||
qt/OpenRGBSoftwareInfoPage.ui \
|
||||
qt/OpenRGBSystemInfoPage.ui
|
||||
qt/OpenRGBSystemInfoPage.ui \
|
||||
qt/OpenRGBZoneResizeDialog.ui
|
||||
|
||||
#-----------------------------------------------
|
||||
# Windows specific project configuration
|
||||
|
|
|
|||
|
|
@ -120,6 +120,8 @@ typedef struct
|
|||
zone_type type; /* Zone type */
|
||||
std::vector<std::vector<int>>
|
||||
map; /* LED index map */
|
||||
unsigned int leds_min;
|
||||
unsigned int leds_max;
|
||||
} zone;
|
||||
|
||||
class RGBController
|
||||
|
|
|
|||
|
|
@ -183,9 +183,11 @@ RGBController_CorsairNodePro::RGBController_CorsairNodePro(CorsairNodeProControl
|
|||
char ch_idx_string[2];
|
||||
sprintf(ch_idx_string, "%d", channel_idx + 1);
|
||||
|
||||
new_zone->name = "Corsair Channel ";
|
||||
new_zone->name = "Corsair Channel ";
|
||||
new_zone->name.append(ch_idx_string);
|
||||
new_zone->type = ZONE_TYPE_LINEAR;
|
||||
new_zone->type = ZONE_TYPE_LINEAR;
|
||||
new_zone->leds_min = 0;
|
||||
new_zone->leds_max = 40;
|
||||
|
||||
std::vector<int> *new_zone_map = new std::vector<int>();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#include "OpenRGBDevicePage.h"
|
||||
#include "OpenRGBZoneResizeDialog.h"
|
||||
#include "hsv.h"
|
||||
|
||||
using namespace Ui;
|
||||
|
|
@ -108,6 +109,8 @@ void Ui::OpenRGBDevicePage::on_ZoneBox_currentIndexChanged(int /*index*/)
|
|||
{
|
||||
ui->LEDBox->addItem(device->leds[i].name.c_str());
|
||||
}
|
||||
|
||||
ui->ResizeButton->setEnabled(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -120,6 +123,15 @@ void Ui::OpenRGBDevicePage::on_ZoneBox_currentIndexChanged(int /*index*/)
|
|||
ui->LEDBox->addItem(device->leds[device->zones[selected_zone].map[y][x]].name.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
if(device->zones[selected_zone].leds_min == device->zones[selected_zone].leds_max)
|
||||
{
|
||||
ui->ResizeButton->setEnabled(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->ResizeButton->setEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
ui->LEDBox->setCurrentIndex(0);
|
||||
|
|
@ -441,6 +453,8 @@ void Ui::OpenRGBDevicePage::UpdateModeUi()
|
|||
ui->LEDBox->blockSignals(true);
|
||||
ui->LEDBox->clear();
|
||||
ui->LEDBox->blockSignals(false);
|
||||
|
||||
ui->ResizeButton->setEnabled(false);
|
||||
break;
|
||||
|
||||
case MODE_COLORS_PER_LED:
|
||||
|
|
@ -477,6 +491,15 @@ void Ui::OpenRGBDevicePage::UpdateModeUi()
|
|||
ui->LEDBox->blockSignals(true);
|
||||
ui->LEDBox->clear();
|
||||
|
||||
if(device->modes[selected_mode].colors_min == device->modes[selected_mode].colors_max)
|
||||
{
|
||||
ui->ResizeButton->setEnabled(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->ResizeButton->setEnabled(true);
|
||||
}
|
||||
|
||||
for (std::size_t i = 0; i < device->modes[selected_mode].colors.size(); i++)
|
||||
{
|
||||
char id_buf[32];
|
||||
|
|
@ -932,3 +955,44 @@ void Ui::OpenRGBDevicePage::on_SetAllButton_clicked()
|
|||
|
||||
emit SetAllDevices(red, green, blue);
|
||||
}
|
||||
|
||||
void Ui::OpenRGBDevicePage::on_ResizeButton_clicked()
|
||||
{
|
||||
switch(device->modes[device->active_mode].color_mode)
|
||||
{
|
||||
case MODE_COLORS_PER_LED:
|
||||
{
|
||||
int selected_zone = ui->ZoneBox->currentIndex();
|
||||
|
||||
selected_zone -= 1;
|
||||
|
||||
if(device->zones[selected_zone].type == ZONE_TYPE_LINEAR)
|
||||
{
|
||||
OpenRGBZoneResizeDialog dlg(device->zones[selected_zone].leds_min,
|
||||
device->zones[selected_zone].leds_max,
|
||||
device->zones[selected_zone].map[0].size());
|
||||
|
||||
int new_size = dlg.show();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case MODE_COLORS_MODE_SPECIFIC:
|
||||
{
|
||||
OpenRGBZoneResizeDialog dlg(device->modes[device->active_mode].colors_min,
|
||||
device->modes[device->active_mode].colors_max,
|
||||
device->modes[device->active_mode].colors.size());
|
||||
|
||||
int new_size = dlg.show();
|
||||
|
||||
if(new_size > 0)
|
||||
{
|
||||
device->modes[device->active_mode].colors.resize(new_size);
|
||||
}
|
||||
|
||||
UpdateModeUi();
|
||||
UpdateMode();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,6 +56,8 @@ private slots:
|
|||
|
||||
void on_ModeSpecificCheck_clicked();
|
||||
|
||||
void on_ResizeButton_clicked();
|
||||
|
||||
private:
|
||||
Ui::OpenRGBDevicePageUi *ui;
|
||||
RGBController *device;
|
||||
|
|
|
|||
|
|
@ -14,131 +14,6 @@
|
|||
<string>Frame</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="1" colspan="3">
|
||||
<widget class="QComboBox" name="ZoneBox"/>
|
||||
</item>
|
||||
<item row="2" column="5" colspan="2">
|
||||
<widget class="QSpinBox" name="RedSpinBox">
|
||||
<property name="maximum">
|
||||
<number>255</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="6">
|
||||
<widget class="QPushButton" name="ButtonGreen">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="7">
|
||||
<widget class="QPushButton" name="ButtonCyan">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="7">
|
||||
<widget class="QLabel" name="SatLabel">
|
||||
<property name="text">
|
||||
<string>S:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="ModeLabel">
|
||||
<property name="text">
|
||||
<string>Mode:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="8" colspan="2">
|
||||
<widget class="QSpinBox" name="ValSpinBox">
|
||||
<property name="maximum">
|
||||
<number>255</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="LEDLabel">
|
||||
<property name="text">
|
||||
<string>LED:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="8" colspan="2">
|
||||
<widget class="QSpinBox" name="SatSpinBox">
|
||||
<property name="maximum">
|
||||
<number>255</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="4">
|
||||
<widget class="QLabel" name="RedLabel">
|
||||
<property name="text">
|
||||
<string>R:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<widget class="QLabel" name="DirectionLabel">
|
||||
<property name="text">
|
||||
<string>Dir:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1" colspan="3">
|
||||
<widget class="QSlider" name="SpeedSlider">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="ZoneLabel">
|
||||
<property name="text">
|
||||
<string>Zone:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="4">
|
||||
<widget class="QLabel" name="BlueLabel">
|
||||
<property name="text">
|
||||
<string>B:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="SetLabel">
|
||||
<property name="text">
|
||||
<string>Set:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="7">
|
||||
<widget class="QLabel" name="ValLabel">
|
||||
<property name="text">
|
||||
<string>V:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" colspan="3">
|
||||
<widget class="QComboBox" name="LEDBox"/>
|
||||
</item>
|
||||
<item row="3" column="5" colspan="2">
|
||||
<widget class="QSpinBox" name="GreenSpinBox">
|
||||
<property name="maximum">
|
||||
<number>255</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="8" colspan="2">
|
||||
<widget class="QSpinBox" name="HueSpinBox">
|
||||
<property name="maximum">
|
||||
<number>359</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QPushButton" name="SetDeviceButton">
|
||||
<property name="text">
|
||||
|
|
@ -146,89 +21,20 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="5" colspan="2">
|
||||
<widget class="QSpinBox" name="BlueSpinBox">
|
||||
<property name="maximum">
|
||||
<number>255</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="8">
|
||||
<widget class="QPushButton" name="ButtonBlue">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="9">
|
||||
<item row="6" column="10">
|
||||
<widget class="QPushButton" name="ButtonMagenta">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1" colspan="3">
|
||||
<widget class="QComboBox" name="ModeBox"/>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="SpeedLabel">
|
||||
<property name="text">
|
||||
<string>Speed:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1" colspan="3">
|
||||
<widget class="QComboBox" name="DirectionBox"/>
|
||||
</item>
|
||||
<item row="2" column="7">
|
||||
<widget class="QLabel" name="HueLabel">
|
||||
<property name="text">
|
||||
<string>H:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QPushButton" name="SetZoneButton">
|
||||
<property name="text">
|
||||
<string>Zone</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="5">
|
||||
<item row="6" column="6">
|
||||
<widget class="QPushButton" name="ButtonYellow">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1" colspan="3">
|
||||
<widget class="QPushButton" name="SetAllButton">
|
||||
<property name="text">
|
||||
<string>Set All Devices</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="4">
|
||||
<widget class="QLabel" name="GreenLabel">
|
||||
<property name="text">
|
||||
<string>G:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="3">
|
||||
<widget class="QPushButton" name="SetLEDButton">
|
||||
<property name="text">
|
||||
<string>LED</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="4">
|
||||
<widget class="QPushButton" name="ButtonRed">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QRadioButton" name="PerLEDCheck">
|
||||
<property name="text">
|
||||
|
|
@ -236,17 +42,27 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="2">
|
||||
<widget class="QRadioButton" name="ModeSpecificCheck">
|
||||
<item row="4" column="6" colspan="2">
|
||||
<widget class="QSpinBox" name="BlueSpinBox">
|
||||
<property name="maximum">
|
||||
<number>255</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1" colspan="4">
|
||||
<widget class="QComboBox" name="ModeBox"/>
|
||||
</item>
|
||||
<item row="3" column="8">
|
||||
<widget class="QLabel" name="SatLabel">
|
||||
<property name="text">
|
||||
<string>Mode-Specific</string>
|
||||
<string>S:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="3">
|
||||
<widget class="QRadioButton" name="RandomCheck">
|
||||
<widget class="QRadioButton" name="ModeSpecificCheck">
|
||||
<property name="text">
|
||||
<string>Random</string>
|
||||
<string>Mode-Specific</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
@ -257,6 +73,197 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" colspan="4">
|
||||
<widget class="QComboBox" name="LEDBox"/>
|
||||
</item>
|
||||
<item row="6" column="7">
|
||||
<widget class="QPushButton" name="ButtonGreen">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="5">
|
||||
<widget class="QLabel" name="BlueLabel">
|
||||
<property name="text">
|
||||
<string>B:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="SpeedLabel">
|
||||
<property name="text">
|
||||
<string>Speed:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1" colspan="4">
|
||||
<widget class="QPushButton" name="SetAllButton">
|
||||
<property name="text">
|
||||
<string>Set All Devices</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="8">
|
||||
<widget class="QLabel" name="ValLabel">
|
||||
<property name="text">
|
||||
<string>V:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<widget class="QLabel" name="DirectionLabel">
|
||||
<property name="text">
|
||||
<string>Dir:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1" colspan="4">
|
||||
<widget class="QComboBox" name="DirectionBox"/>
|
||||
</item>
|
||||
<item row="2" column="5">
|
||||
<widget class="QLabel" name="RedLabel">
|
||||
<property name="text">
|
||||
<string>R:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="4">
|
||||
<widget class="QPushButton" name="SetLEDButton">
|
||||
<property name="text">
|
||||
<string>LED</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="5">
|
||||
<widget class="QLabel" name="GreenLabel">
|
||||
<property name="text">
|
||||
<string>G:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="9">
|
||||
<widget class="QPushButton" name="ButtonBlue">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="3">
|
||||
<widget class="QPushButton" name="SetZoneButton">
|
||||
<property name="text">
|
||||
<string>Zone</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="6" colspan="2">
|
||||
<widget class="QSpinBox" name="RedSpinBox">
|
||||
<property name="maximum">
|
||||
<number>255</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1" colspan="4">
|
||||
<widget class="QSlider" name="SpeedSlider">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="8">
|
||||
<widget class="QLabel" name="HueLabel">
|
||||
<property name="text">
|
||||
<string>H:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="5">
|
||||
<widget class="QPushButton" name="ButtonRed">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="8">
|
||||
<widget class="QPushButton" name="ButtonCyan">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="SetLabel">
|
||||
<property name="text">
|
||||
<string>Set:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="LEDLabel">
|
||||
<property name="text">
|
||||
<string>LED:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="9" colspan="2">
|
||||
<widget class="QSpinBox" name="HueSpinBox">
|
||||
<property name="maximum">
|
||||
<number>359</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="9" colspan="2">
|
||||
<widget class="QSpinBox" name="ValSpinBox">
|
||||
<property name="maximum">
|
||||
<number>255</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="4">
|
||||
<widget class="QRadioButton" name="RandomCheck">
|
||||
<property name="text">
|
||||
<string>Random</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="6" colspan="2">
|
||||
<widget class="QSpinBox" name="GreenSpinBox">
|
||||
<property name="maximum">
|
||||
<number>255</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="9" colspan="2">
|
||||
<widget class="QSpinBox" name="SatSpinBox">
|
||||
<property name="maximum">
|
||||
<number>255</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="ZoneLabel">
|
||||
<property name="text">
|
||||
<string>Zone:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="ModeLabel">
|
||||
<property name="text">
|
||||
<string>Mode:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" colspan="3">
|
||||
<widget class="QComboBox" name="ZoneBox"/>
|
||||
</item>
|
||||
<item row="0" column="4">
|
||||
<widget class="QPushButton" name="ResizeButton">
|
||||
<property name="text">
|
||||
<string>Resize</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
|
|
|
|||
53
qt/OpenRGBZoneResizeDialog.cpp
Normal file
53
qt/OpenRGBZoneResizeDialog.cpp
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
#include "OpenRGBZoneResizeDialog.h"
|
||||
|
||||
using namespace Ui;
|
||||
|
||||
OpenRGBZoneResizeDialog::OpenRGBZoneResizeDialog(int size_min, int size_max, int size_current, QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::OpenRGBZoneResizeDialogUi)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
ui->ResizeSlider->setRange(size_min, size_max);
|
||||
ui->ResizeBox->setRange(size_min, size_max);
|
||||
|
||||
ui->ResizeSlider->setValue(size_current);
|
||||
ui->ResizeBox->setValue(size_current);
|
||||
}
|
||||
|
||||
OpenRGBZoneResizeDialog::~OpenRGBZoneResizeDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void Ui::OpenRGBZoneResizeDialog::on_ResizeSlider_valueChanged(int value)
|
||||
{
|
||||
ui->ResizeBox->blockSignals(true);
|
||||
ui->ResizeBox->setValue(value);
|
||||
ui->ResizeBox->blockSignals(false);
|
||||
}
|
||||
|
||||
void Ui::OpenRGBZoneResizeDialog::on_ResizeBox_valueChanged(int value)
|
||||
{
|
||||
ui->ResizeSlider->blockSignals(true);
|
||||
ui->ResizeSlider->setValue(value);
|
||||
ui->ResizeSlider->blockSignals(false);
|
||||
}
|
||||
|
||||
int Ui::OpenRGBZoneResizeDialog::show()
|
||||
{
|
||||
int ret_val = 0;
|
||||
|
||||
int result = this->exec();
|
||||
|
||||
if(result == QDialog::Rejected)
|
||||
{
|
||||
ret_val = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret_val = ui->ResizeBox->value();
|
||||
}
|
||||
|
||||
return(ret_val);
|
||||
}
|
||||
30
qt/OpenRGBZoneResizeDialog.h
Normal file
30
qt/OpenRGBZoneResizeDialog.h
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#ifndef OPENRGBZONERESIZEDIALOG_H
|
||||
#define OPENRGBZONERESIZEDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include "ui_OpenRGBZoneResizeDialog.h"
|
||||
|
||||
namespace Ui {
|
||||
class OpenRGBZoneResizeDialog;
|
||||
}
|
||||
|
||||
class Ui::OpenRGBZoneResizeDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit OpenRGBZoneResizeDialog(int size_min, int size_max, int size_current, QWidget *parent = nullptr);
|
||||
~OpenRGBZoneResizeDialog();
|
||||
|
||||
int show();
|
||||
|
||||
private slots:
|
||||
void on_ResizeSlider_valueChanged(int value);
|
||||
|
||||
void on_ResizeBox_valueChanged(int arg1);
|
||||
|
||||
private:
|
||||
Ui::OpenRGBZoneResizeDialogUi *ui;
|
||||
};
|
||||
|
||||
#endif // OPENRGBZONERESIZEDIALOG_H
|
||||
91
qt/OpenRGBZoneResizeDialog.ui
Normal file
91
qt/OpenRGBZoneResizeDialog.ui
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>OpenRGBZoneResizeDialogUi</class>
|
||||
<widget class="QDialog" name="OpenRGBZoneResizeDialogUi">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>180</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Resize Zone</string>
|
||||
</property>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>140</y>
|
||||
<width>341</width>
|
||||
<height>32</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QSlider" name="ResizeSlider">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>20</y>
|
||||
<width>361</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QSpinBox" name="ResizeBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>260</x>
|
||||
<y>80</y>
|
||||
<width>121</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>OpenRGBZoneResizeDialogUi</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>OpenRGBZoneResizeDialogUi</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
Loading…
Add table
Add a link
Reference in a new issue