summaryrefslogtreecommitdiffstats
path: root/kicker/applets/minipager/pagerbutton.cpp
diff options
context:
space:
mode:
authorMavridis Philippe <[email protected]>2025-01-14 22:11:03 +0200
committerMavridis Philippe <[email protected]>2025-01-14 22:11:03 +0200
commite32320914b20380bdc8f2132604848f5250e2ddd (patch)
tree5e8902b6e1d8aa8498b1d03039977e57369d54f3 /kicker/applets/minipager/pagerbutton.cpp
parente258ca7b22927e9670eb6b4c7395924483079ac6 (diff)
downloadtdebase-feat/kicker/improvements.tar.gz
tdebase-feat/kicker/improvements.zip
Kicker: add ability to rename desktops when minipager label not displaying desktop namefeat/kicker/improvements
This was disabled because it relied on the desktop button being wide enough to accomodate a line edit. With this commit when the label is not displaying the desktop name, a TQInputDialog will ask for a new name instead. Signed-off-by: Mavridis Philippe <[email protected]>
Diffstat (limited to 'kicker/applets/minipager/pagerbutton.cpp')
-rw-r--r--kicker/applets/minipager/pagerbutton.cpp36
1 files changed, 25 insertions, 11 deletions
diff --git a/kicker/applets/minipager/pagerbutton.cpp b/kicker/applets/minipager/pagerbutton.cpp
index 5c4bf71e8..32eeae31b 100644
--- a/kicker/applets/minipager/pagerbutton.cpp
+++ b/kicker/applets/minipager/pagerbutton.cpp
@@ -29,6 +29,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <tqpainter.h>
#include <tqpopupmenu.h>
#include <tqstylesheet.h>
+#include <tqinputdialog.h>
#include <netwm.h>
#include <dcopclient.h>
@@ -703,17 +704,30 @@ void KMiniPagerButton::slotClicked()
void KMiniPagerButton::rename()
{
- if ( !m_lineEdit ) {
- m_lineEdit = new TQLineEdit( this );
- connect( m_lineEdit, TQ_SIGNAL( returnPressed() ), m_lineEdit, TQ_SLOT( hide() ) );
- m_lineEdit->installEventFilter( this );
- }
- m_lineEdit->setGeometry( rect() );
- m_lineEdit->setText(m_desktopName);
- m_lineEdit->show();
- m_lineEdit->setFocus();
- m_lineEdit->selectAll();
- m_pager->emitRequestFocus();
+ if (m_pager->labelType() == PagerSettings::EnumLabelType::LabelName)
+ {
+ if ( !m_lineEdit ) {
+ m_lineEdit = new TQLineEdit(this);
+ connect(m_lineEdit, TQ_SIGNAL(returnPressed()), m_lineEdit, TQ_SLOT(hide()));
+ m_lineEdit->installEventFilter(this);
+ }
+ m_lineEdit->setGeometry(rect());
+ m_lineEdit->setText(m_desktopName);
+ m_lineEdit->show();
+ m_lineEdit->setFocus();
+ m_lineEdit->selectAll();
+ m_pager->emitRequestFocus();
+ }
+ else
+ {
+ m_pager->twin()->setDesktopName(
+ m_desktop,
+ TQInputDialog::getText(
+ i18n("Renaming desktop %1").arg(m_desktopName),
+ i18n("Enter a new name for desktop %1 (%2):").arg(m_desktop).arg(m_desktopName)
+ )
+ );
+ }
}
void KMiniPagerButton::slotToggled( bool b )