mirror of
https://github.com/simple64/simple64.git
synced 2026-11-15 07:59:21 +01:00
update gui
This commit is contained in:
1 parent
29458b2c6e
commit
f252e1e6ae
2 files changed
+11
-7
No files matched your search
@@ -381,7 +381,7 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
|
||||
if (!settings->contains("volume"))
|
||||
settings->setValue("volume", 100);
|
||||
VolumeAction * volumeAction = new VolumeAction(tr("Volume"));
|
||||
VolumeAction * volumeAction = new VolumeAction(tr("Volume"), this);
|
||||
connect(volumeAction->slider(), SIGNAL(valueChanged(int)), this, SLOT(volumeValueChanged(int)));
|
||||
volumeAction->slider()->setValue(settings->value("volume").toInt());
|
||||
ui->menuEmulation->insertAction(ui->actionMute, volumeAction);
|
||||
|
||||
@@ -157,13 +157,13 @@ extern MainWindow *w;
|
||||
|
||||
class VolumeAction : public QWidgetAction {
|
||||
public:
|
||||
VolumeAction (const QString& title) :
|
||||
QWidgetAction (NULL) {
|
||||
QWidget* pWidget = new QWidget (NULL);
|
||||
QHBoxLayout* pLayout = new QHBoxLayout();
|
||||
QLabel* pLabel = new QLabel (title);
|
||||
VolumeAction (const QString& title, QObject* parent) :
|
||||
QWidgetAction (parent) {
|
||||
QWidget* pWidget = new QWidget;
|
||||
QHBoxLayout* pLayout = new QHBoxLayout(pWidget);
|
||||
QLabel* pLabel = new QLabel (title, pWidget);
|
||||
pLayout->addWidget (pLabel);
|
||||
pSlider = new QSlider(Qt::Horizontal);
|
||||
pSlider = new QSlider(Qt::Horizontal, pWidget);
|
||||
pSlider->setMinimum(0);
|
||||
pSlider->setMaximum(100);
|
||||
pLayout->addWidget (pSlider);
|
||||
@@ -171,6 +171,10 @@ public:
|
||||
|
||||
setDefaultWidget(pWidget);
|
||||
}
|
||||
void releaseWidget(QWidget* widget)
|
||||
{
|
||||
widget->deleteLater();
|
||||
}
|
||||
|
||||
QSlider * slider () {
|
||||
return pSlider;
|
||||
|
||||
Reference in new issue
Block a user