summaryrefslogtreecommitdiffstats
path: root/kicker/kicker
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-04-12 16:49:43 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-04-12 16:49:43 -0500
commit18098b4c7042e7ce2f965964bb8977b4f17b9842 (patch)
tree5208af2813df58ff9ef7d5c878a516bd54c368d9 /kicker/kicker
parentb28da13a4da674958eea60d6be6594766e42c757 (diff)
downloadtdebase-18098b4c7042e7ce2f965964bb8977b4f17b9842.tar.gz
tdebase-18098b4c7042e7ce2f965964bb8977b4f17b9842.zip
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
Diffstat (limited to 'kicker/kicker')
-rw-r--r--kicker/kicker/buttons/kbutton.cpp23
-rw-r--r--kicker/kicker/buttons/kbutton.h12
-rw-r--r--kicker/kicker/core/container_button.cpp13
3 files changed, 44 insertions, 4 deletions
diff --git a/kicker/kicker/buttons/kbutton.cpp b/kicker/kicker/buttons/kbutton.cpp
index 2f84badb0..88b664059 100644
--- a/kicker/kicker/buttons/kbutton.cpp
+++ b/kicker/kicker/buttons/kbutton.cpp
@@ -56,6 +56,9 @@ KButton::KButton( TQWidget* parent )
setButtonText(KickerSettings::kMenuText());
setFont(KickerSettings::buttonFont());
setTextColor(KickerSettings::buttonTextColor());
+ setMaximumHeight(30);
+ setMaximumWidth(widthForHeight(30));
+ setCenterButtonInContainer(false);
}
}
@@ -64,6 +67,26 @@ KButton::~KButton()
MenuManager::the()->unregisterKButton(this);
}
+int KButton::widthForHeight(int height) const
+{
+ if (KickerSettings::showKMenuText()) {
+ return PanelPopupButton::widthForHeight(30);
+ }
+ else {
+ return PanelPopupButton::widthForHeight(height);
+ }
+}
+
+int KButton::heightForWidth(int width) const
+{
+ if (KickerSettings::showKMenuText()) {
+ return 30;
+ }
+ else {
+ return PanelPopupButton::heightForWidth(width);
+ }
+}
+
void KButton::properties()
{
TDEApplication::startServiceByDesktopName("kmenuedit", TQStringList(),
diff --git a/kicker/kicker/buttons/kbutton.h b/kicker/kicker/buttons/kbutton.h
index a051e9d57..896bf56c2 100644
--- a/kicker/kicker/buttons/kbutton.h
+++ b/kicker/kicker/buttons/kbutton.h
@@ -41,6 +41,18 @@ public:
virtual void properties();
+ /**
+ * Reimplement this to give Kicker a hint for the width of the button
+ * given a certain height.
+ */
+ virtual int widthForHeight(int height) const;
+
+ /**
+ * Reimplement this to give Kicker a hint for the height of the button
+ * given a certain width.
+ */
+ virtual int heightForWidth(int width) const;
+
protected:
virtual TQString tileName() { return "KMenu"; }
virtual void initPopup();
diff --git a/kicker/kicker/core/container_button.cpp b/kicker/kicker/core/container_button.cpp
index 178d83bae..fa3814bfb 100644
--- a/kicker/kicker/core/container_button.cpp
+++ b/kicker/kicker/core/container_button.cpp
@@ -145,12 +145,17 @@ void ButtonContainer::embedButton(PanelButton* b)
{
if (!b) return;
- delete _layout;
- _layout = new TQVBoxLayout(this);
- _button = b;
+ if (_layout) delete _layout;
+ _button = b;
_button->installEventFilter(this);
- _layout->add(_button);
+
+ if (b->centerButtonInContainer()) {
+ TQVBoxLayout* vbox = new TQVBoxLayout(this);
+ vbox->addWidget(_button);
+ _layout = vbox;
+ }
+
connect(_button, TQT_SIGNAL(requestSave()), TQT_SIGNAL(requestSave()));
connect(_button, TQT_SIGNAL(hideme(bool)), TQT_SLOT(hideRequested(bool)));
connect(_button, TQT_SIGNAL(removeme()), TQT_SLOT(removeRequested()));