From 7cc4d46cf55b013a02b6c3b7df6b5d536e69f1f1 Mon Sep 17 00:00:00 2001 From: Mavridis Philippe Date: Sat, 8 Jun 2024 14:55:58 +0300 Subject: [PATCH] Mouse TDECM: do not hide checkboxes in case of option unavailability Signed-off-by: Mavridis Philippe --- kcontrol/input/mouse.cpp | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/kcontrol/input/mouse.cpp b/kcontrol/input/mouse.cpp index b0f9debf0..523696761 100644 --- a/kcontrol/input/mouse.cpp +++ b/kcontrol/input/mouse.cpp @@ -160,33 +160,16 @@ MouseConfig::MouseConfig (TQWidget * parent, const char *name) connect( tab1->doubleClick, TQ_SIGNAL( clicked() ), this, TQ_SLOT( slotClick() ) ); connect( tab1->cbAutoSelect, TQ_SIGNAL( clicked() ), this, TQ_SLOT( slotClick() ) ); - // Only allow setting reversing scroll polarity if we have scroll buttons unsigned char map[20]; int buttonCount = XGetPointerMapping(kapp->getDisplay(), map, 20); - if ( buttonCount >= 5 ) - { - tab1->cbScrollPolarity->setEnabled( true ); - tab1->cbScrollPolarity->show(); - } - else - { - tab1->cbScrollPolarity->setEnabled( false ); - tab1->cbScrollPolarity->hide(); - } + + // Only allow setting reversing scroll polarity if we have scroll buttons + tab1->cbScrollPolarity->setEnabled(buttonCount >= 5); connect(tab1->cbScrollPolarity, TQ_SIGNAL(clicked()), this, TQ_SLOT(changed())); connect(tab1->cbScrollPolarity, TQ_SIGNAL(clicked()), this, TQ_SLOT(slotScrollPolarityChanged())); // Only allow setting reversing history buttons (8, 9) if we have actually have them - if ( buttonCount >= 9 ) - { - tab1->cbRevHistButtons->setEnabled( true ); - tab1->cbRevHistButtons->show(); - } - else - { - tab1->cbRevHistButtons->setEnabled( false ); - tab1->cbRevHistButtons->hide(); - } + tab1->cbRevHistButtons->setEnabled(buttonCount >= 9); connect(tab1->cbRevHistButtons, TQ_SIGNAL(clicked()), this, TQ_SLOT(changed())); connect(tab1->cbRevHistButtons, TQ_SIGNAL(clicked()), this, TQ_SLOT(slotRevHistButtonsChanged()));