62 QWidget *_headerAreaWidget) :
65 headerAreaWidget_(_headerAreaWidget),
74 QHBoxLayout *hl =
new QHBoxLayout;
75 hl->setContentsMargins(2, 2, 2, 2);
79 label_ =
new QLabel (_name);
80 label_->setFont (font);
82 iconHolder_ =
new QLabel ();
85 iconHolder_->setPixmap( icon_->pixmap(22,22) );
87 QPixmap pic(QSize(22,22));
88 pic.fill( QColor(0,0,0,0) );
90 iconHolder_->setPixmap( pic );
93 detachButton_ =
new QToolButton ();
94 detachButton_->setAutoRaise(
true);
95 hl->addWidget (iconHolder_);
96 hl->addWidget (label_);
97 if (headerAreaWidget_) {
98 headerAreaWidget_->setVisible(
false);
99 connect(
this, SIGNAL(toggleActive(
bool)), headerAreaWidget_, SLOT(setVisible(
bool)));
100 hl->addWidget (headerAreaWidget_);
103 hl->addWidget (detachButton_);
106 QIcon detachIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+
"button-detach.png");
107 detachIcon.addPixmap(QPixmap(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+
"button-detach_over.png"), QIcon::Active);
108 detachIcon.addPixmap(QPixmap(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+
"button-detach_over.png"), QIcon::Selected);
110 detachAction_ =
new QAction ( detachIcon,
"",
this);
111 detachAction_->setToolTip( tr(
"Show as separate window") );
112 detachAction_->setCheckable (
true);
113 detachButton_->setDefaultAction (detachAction_);
115 connect (detachAction_, SIGNAL (triggered (
bool)),
this, SLOT (
detachPressed (
bool)));
119 QFrame *f =
new QFrame ();
120 f->setFrameShape (QFrame::HLine);
122 mainLayout_ =
new QVBoxLayout;
124 mainLayout_->addWidget (f);
125 mainLayout_->addWidget (tra);
126 mainLayout_->addWidget (_w);
127 mainLayout_->setSpacing (0);
128 mainLayout_->setContentsMargins(0, 0, 0, 0);
129 setLayout (mainLayout_);
204 mainLayout_->removeWidget (widget_);
205 dialog_ =
new QDialog(0, Qt::Window);
206 dialog_->setWindowTitle (name_);
207 dialog_->setWindowIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+
"button-detach.png"));
208 dialog_->setLayout (
new QVBoxLayout);
209 dialog_->resize (widget_->size ());
212 int x = (window ()->width () - widget_->width ()) / 2;
213 x += window ()->x ();
215 int y = (window ()->height () - widget_->height ()) / 2;
216 y += window ()->y ();
218 dialog_->move (x, y);
220 dialog_->layout ()->addWidget (widget_);
222 widget_->setAttribute(Qt::WA_DeleteOnClose,
false);
225 connect (dialog_, SIGNAL(finished (
int)),
this, SLOT(
dialogClosed ()));
229 font.setItalic (
true);
230 label_->setFont (font);