PanelButton::PanelButton( QWidget* parent, const char* name ) : QButton(parent, name), m_valid(true), m_isLeftMouseButtonDown(false), m_drawArrow(false), m_highlight(false), m_changeCursorOverItem(true), m_hasAcceptedDrag(false), m_arrowDirection(KPanelExtension::Bottom), m_popupDirection(KPanelApplet::Up), m_orientation(Horizontal), m_size((KIcon::StdSizes)-1), m_fontPercent(0.40) { KGlobal::locale()->insertCatalogue("libkicker"); calculateIconSize(); setAcceptDrops(true); m_textColor = KGlobalSettings::textColor(); updateSettings(KApplication::SETTINGS_MOUSE); kapp->addKipcEventMask(KIPC::SettingsChanged | KIPC::IconChanged); installEventFilter(KickerTip::the()); connect(kapp, SIGNAL(settingsChanged(int)), SLOT(updateSettings(int))); connect(kapp, SIGNAL(iconChanged(int)), SLOT(updateIcon(int))); }
void PanelButton::resizeEvent(QResizeEvent*) { loadTiles(); if (calculateIconSize()) { loadIcons(); } }
int QIrParabolicEffectManager::calculateReach() const { QIR_P(const QIrParabolicEffectManager); QIrDock * dock = p->view->dock(); QIrDockStyle * style = dock->dockStyle(); qreal distance = 0; QSizeF w(0,0); int spacing = p->view->dockletSpacing(); QList< QIrDockletBundle * > bundles = p->view->bundles(); QSizeF minR = sizeForIconSize(style,spacing,dock->effectiveMinimumIconSize(),dock->effectiveMinimumIconSize(),dock->maximumIconSize(),true,dock->orientation()); int minS = (int)(dock->orientation() == Qt::Horizontal ? minR.width() : minR.height()); w += sizeForIconSize(style,spacing,dock->effectiveMinimumIconSize(),calculateIconSize((int)distance),dock->maximumIconSize(),true,dock->orientation()) / 2.0; for (int i = 1; i <= p->coverage; i++) { distance += minS; w += sizeForIconSize(style,spacing,dock->effectiveMinimumIconSize(),calculateIconSize((int)distance),dock->maximumIconSize(),true,dock->orientation()); } return (int)(dock->orientation() == Qt::Horizontal ? w.width() : w.height()); }