void KisColorPatches::resizeEvent(QResizeEvent* event) { if(size()==QSize(1, 1)) return; QWheelEvent dummyWheelEvent(QPoint(), 0, Qt::NoButton, Qt::NoModifier); wheelEvent(&dummyWheelEvent); if(parentWidget()==0) { // this instance is a popup setMinimumWidth(m_patchWidth*(m_patchCount/4)); setMaximumWidth(minimumWidth()); } if(m_allowScrolling == false && event->oldSize() != event->size()) { if(m_direction == Horizontal) { setMaximumHeight(heightForWidth(width())); setMinimumHeight(heightForWidth(width())); } else { setMaximumWidth(widthForHeight(height())); setMinimumWidth(widthForHeight(height())); } } }
AppletHandle::AppletHandle(AppletContainer* parent) : QWidget(parent), m_applet(parent), m_menuButton(0), m_drawHandle(false), m_popupDirection(KPanelApplet::Up), m_handleHoverTimer(0) { setBackgroundOrigin(AncestorOrigin); setMinimumSize(widthForHeight(0), heightForWidth(0)); m_layout = new QBoxLayout(this, QBoxLayout::BottomToTop, 0, 0); m_dragBar = new AppletHandleDrag(this); m_dragBar->installEventFilter(this); m_layout->addWidget(m_dragBar); if (kapp->authorizeKAction("kicker_rmb")) { m_menuButton = new AppletHandleButton( this ); m_menuButton->setPixmap(xpmPixmap(up_xpm, "up")); m_menuButton->installEventFilter(this); m_layout->addWidget(m_menuButton); connect(m_menuButton, SIGNAL(pressed()), this, SLOT(menuButtonPressed())); QToolTip::add(m_menuButton, i18n("%1 menu").arg(parent->info().name())); } QToolTip::add(this, i18n("%1 applet handle").arg(parent->info().name())); resetLayout(); }
int ContainerAreaLayout::widthForHeightR(int h) const { if (orientation() == Horizontal) { return widthForHeight(h); } else { return heightForWidth(h); } }
QSize ContainerAreaLayout::minimumSize() const { const int size = KickerLib::sizeValue(KPanelExtension::SizeTiny); if (orientation() == Horizontal) { return QSize(widthForHeight(size), size); } else { return QSize(size, heightForWidth(size)); } }