shortcut "fixed"

This commit is contained in:
mrbesen 2021-12-15 00:04:35 +01:00
parent 96a1556d7b
commit 3aee5192b6
Signed by untrusted user: MrBesen
GPG Key ID: 596B2350DCD67504
4 changed files with 24 additions and 6 deletions

@ -1 +1 @@
Subproject commit cf3448884274f2e9cd360ff33982128401c4737b
Subproject commit 336b6f5780109501dd8c3d98ca336265af021808

View File

@ -11,12 +11,12 @@ MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent), ui(new Ui::Soundb
reloadConfig();
QKeySequence seq("Num+,");
stopGlobal = new QxtGlobalShortcut(seq);
// QKeySequence seq(QString::fromStdString("Shift+Num+0"));
// stopGlobal = new QxtGlobalShortcut(seq);
QObject::connect(ui->reloadButton, SIGNAL(clicked()), this, SLOT(reloadConfig()));
QObject::connect(ui->stopButton, SIGNAL( clicked() ), this, SLOT( stop() ));
QObject::connect(stopGlobal, SIGNAL( activated() ), this, SLOT( stop() ));
// QObject::connect(stopGlobal, SIGNAL( activated() ), this, SLOT( stop() ));
QObject::connect(this, SIGNAL(newStatusMessage(const QString&)), ui->statusbar, SLOT(showMessage(const QString&)));
}
@ -103,8 +103,10 @@ void MainWindow::loadButtonsFromConfig() {
x += bc.width;
}
ui->gridLayout->setRowMinimumHeight(y, 40);
ui->gridLayout->setRowMinimumHeight(y, 60);
x = 0;
y++;
}
// ui->gridLayoutWidget->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
}

View File

@ -9,8 +9,18 @@ uint64_t SoundButton::nextid = 0;
SoundButton::SoundButton(const std::string& filename, const std::string& name_, const std::string& keycombo) : id(nextid++), file(filename), keycombo(keycombo) {
name = (name_.empty() ? filename : name_);
button = new QPushButton(QString::fromStdString(name));
std::string keycomb;
if(!keycombo.empty()) {
keycomb = "\n" + keycombo;
}
QString info = QString::fromStdString(name + keycomb);
button = new QPushButton(info);
button->setObjectName(QString::fromStdString("soundButton" + std::to_string(id)));
button->setMinimumHeight(50);
button->setToolTip(info);
// button->setSizePolicy(QSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum));
QKeySequence seq(QString::fromStdString(keycombo));
globalShortcut = new QxtGlobalShortcut(seq);

View File

@ -14,6 +14,12 @@
<string>Soundboard</string>
</property>
<widget class="QWidget" name="centralwidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<widget class="QWidget" name="gridLayoutWidget">
<property name="geometry">
<rect>