summaryrefslogtreecommitdiffstats
path: root/kicker
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
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')
-rw-r--r--kicker/applets/minipager/pagerapplet.cpp3
-rw-r--r--kicker/applets/minipager/pagerbutton.cpp36
2 files changed, 25 insertions, 14 deletions
diff --git a/kicker/applets/minipager/pagerapplet.cpp b/kicker/applets/minipager/pagerapplet.cpp
index eadb23b91..a4aa1bde1 100644
--- a/kicker/applets/minipager/pagerapplet.cpp
+++ b/kicker/applets/minipager/pagerapplet.cpp
@@ -770,9 +770,6 @@ void KMiniPager::aboutToShowContextMenu()
m_contextMenu->setItemChecked(Cycle, m_settings->cycle());
m_contextMenu->setItemChecked(Border3D, m_settings->border3D());
m_contextMenu->setItemEnabled(WindowIcons, m_settings->preview());
- m_contextMenu->setItemEnabled(RenameDesktop,
- m_settings->labelType() ==
- PagerSettings::EnumLabelType::LabelName);
}
void KMiniPager::slotShowMenu(const TQPoint& pos, int desktop)
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 )