From 18098b4c7042e7ce2f965964bb8977b4f17b9842 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Fri, 12 Apr 2013 16:49:43 -0500 Subject: Add initial taskbar drag and drop support This partially resolves Bug 1103 Save horizontal space around TDE Menu button when text is in use and Kicker is greater than one line in height --- kicker/libkicker/panelbutton.cpp | 10 ++++++++++ kicker/libkicker/panelbutton.h | 11 +++++++++++ 2 files changed, 21 insertions(+) (limited to 'kicker/libkicker') diff --git a/kicker/libkicker/panelbutton.cpp b/kicker/libkicker/panelbutton.cpp index 9f05d1f90..0bd13ac7b 100644 --- a/kicker/libkicker/panelbutton.cpp +++ b/kicker/libkicker/panelbutton.cpp @@ -70,6 +70,7 @@ PanelButton::PanelButton( TQWidget* parent, const char* name, bool forceStandard m_highlight(false), m_changeCursorOverItem(forceStandardCursor?false:true), m_hasAcceptedDrag(false), + m_centerInContainer(true), m_arrowDirection(KPanelExtension::Bottom), m_popupDirection(KPanelApplet::Up), m_iconAlignment(AlignCenter), @@ -938,6 +939,10 @@ bool PanelButton::calculateIconSize() return false; } +void PanelButton::setCenterButtonInContainer(bool center) { + m_centerInContainer = center; +} + void PanelButton::updateKickerTip(KickerTip::Data& data) { data.message = TQStyleSheet::escape(title()); @@ -946,6 +951,11 @@ void PanelButton::updateKickerTip(KickerTip::Data& data) data.direction = popupDirection(); } +bool PanelButton::centerButtonInContainer() +{ + return m_centerInContainer; +} + // // PanelPopupButton class // diff --git a/kicker/libkicker/panelbutton.h b/kicker/libkicker/panelbutton.h index b67bc2b9a..80b26f377 100644 --- a/kicker/libkicker/panelbutton.h +++ b/kicker/libkicker/panelbutton.h @@ -205,6 +205,11 @@ public: */ void updateKickerTip(KickerTip::Data& data); + /** + * @return true if the button should be centered in its parent container, false if not + */ + bool centerButtonInContainer(); + signals: /** * Emitted when the button's icon is changed. @@ -347,6 +352,11 @@ protected: */ bool calculateIconSize(); + /** + * @param center true if the button should be centered in its parent container, false if not + */ + void setCenterButtonInContainer(bool center); + bool m_valid; TQPixmap m_icon; @@ -382,6 +392,7 @@ private: bool m_highlight; bool m_changeCursorOverItem; bool m_hasAcceptedDrag; + bool m_centerInContainer; TQColor m_textColor; TQColor m_tileColor; TQString m_buttonText; -- cgit v1.2.1