aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop/panel-plugins/audioplayer/LPAudioPlayer.cpp
blob: 5669aaf5876b3129538fabcba021ff23447ac979 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//===========================================
//  Lumina-DE source code
//  Copyright (c) 2014, Susanne Jaeckel
//  Available under the 3-clause BSD license
//  See the LICENSE file for full details
//===========================================
#include "LPAudioPlayer.h"
#include "LSession.h"

LPAudioPlayer::LPAudioPlayer(QWidget *parent, QString id, bool horizontal) : LPPlugin(parent, id, horizontal){
  //Setup the button
    button = new QToolButton(this);
    button->setAutoRaise(true);
    button->setToolButtonStyle(Qt::ToolButtonIconOnly);
    button->setPopupMode(QToolButton::InstantPopup); //make sure it runs the update routine first
    //connect(button, SIGNAL(clicked()), this, SLOT(openMenu()));
    this->layout()->setContentsMargins(0,0,0,0);
    this->layout()->addWidget(button);
  wact = new QWidgetAction(this);
  aplayer = new PPlayerWidget(this);
  button ->setMenu(new QMenu(this) );
  wact->setDefaultWidget(aplayer);
  button->menu()->addAction(wact);
  //Now start up the widgets
  button->setIcon( LXDG::findIcon("audio-volume-high","") );
  QTimer::singleShot(0,this,SLOT(OrientationChange()) ); //update the sizing/icon
}

LPAudioPlayer::~LPAudioPlayer(){
}
bgstack15