UimApplet::UimApplet(const QString& configFile, Type type, int actions, QWidget *parent, const char *name) : KPanelApplet(configFile, type, actions, parent, name) { uim_init(); setBackgroundMode(QWidget::X11ParentRelative); toolbar = new UimToolbar(this); toolbar->resize(QSize(toolbar->preferedWidthForHeight(), size().height())); toolbar->show(); QObject::connect( toolbar, SIGNAL( toolbarResized() ), this, SLOT( slotToolbarResized() ) ); setCustomMenu(toolbar->contextMenu()); }
UimStandaloneToolbar::UimStandaloneToolbar( QWidget *parent, const char *name ) : QHBox( parent, name, Qt::WStyle_NoBorder | Qt::WX11BypassWM ) { uim_init(); adjustSize(); UimToolbarDraggingHandler *h = new UimToolbarDraggingHandler( this ); h->adjustSize(); h->show(); QObject::connect( h, SIGNAL( handleDoubleClicked() ), this, SLOT( slotToolbarDoubleClicked() ) ); toolbar = new QUimHelperToolbar( this ); toolbar->adjustSize(); toolbar->show(); QObject::connect( toolbar, SIGNAL( toolbarResized() ), this, SLOT( slotToolbarResized() ) ); toolbar->setMargin(TOOLBAR_MARGIN_SIZE); // Move int panelHeight = 64; // FIXME! int screenwidth = QApplication::desktop() ->screenGeometry().width(); int screenheight = QApplication::desktop() ->screenGeometry().height(); QPoint p( screenwidth - width() - panelHeight, screenheight - height() - panelHeight ); move( p ); // Enable Dragging Feature QObject::connect( h, SIGNAL( moveTo( const QPoint & ) ), this, SLOT( move( const QPoint & ) ) ); // Quit QObject::connect( toolbar, SIGNAL( quitToolbar() ), qApp, SLOT( quit() ) ); show(); }
void QUimHelperToolbar::slotIndicatorResized() { emit toolbarResized(); }