summaryrefslogtreecommitdiffstats
path: root/twin/useractions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'twin/useractions.cpp')
-rw-r--r--twin/useractions.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/twin/useractions.cpp b/twin/useractions.cpp
index fe60c4d04..fddc4cb38 100644
--- a/twin/useractions.cpp
+++ b/twin/useractions.cpp
@@ -116,7 +116,7 @@ TQPopupMenu* Workspace::clientPopup()
connect(transButton, TQ_SIGNAL(clicked()), TQ_SLOT(resetClientOpacity()));
connect(transButton, TQ_SIGNAL(clicked()), trans_popup, TQ_SLOT(hide()));
connect(transSlider, TQ_SIGNAL(valueChanged(int)), TQ_SLOT(setTransButtonText(int)));
- connect(transSlider, TQ_SIGNAL(valueChanged(int)), this, TQ_SLOT(setPopupClientOpacity(int)));
+ connect(transSlider, TQ_SIGNAL(valueChanged(int)), this, TQ_SLOT(setPopupClientTransparancy(int)));
// connect(transSlider, TQ_SIGNAL(sliderReleased()), trans_popup, TQ_SLOT(hide()));
trans_popup->insertItem(transBox);
popup->insertItem(i18n("&Opacity"), trans_popup );
@@ -143,11 +143,11 @@ TQPopupMenu* Workspace::clientPopup()
}
//sets the transparency of the client to given value(given by slider)
-void Workspace::setPopupClientOpacity(int value)
+void Workspace::setPopupClientTransparancy(int value)
{
active_popup_client->setCustomOpacityFlag(true);
- value = 100 - value;
- value<100?active_popup_client->setOpacity(true, (uint)((value/100.0)*0xffffffff)):active_popup_client->setOpacity(false,0xffffffff);
+ int opacityPercent = 100 - value;
+ active_popup_client->setOpacity(percentToUint(opacityPercent));
}
void Workspace::setTransButtonText(int value)
@@ -648,25 +648,26 @@ bool Client::performMouseCommand( Options::MouseCommand command, TQPoint globalP
workspace()->windowToNextDesktop( this );
break;
case Options::MouseOpacityMore:
- if (opacity_ < 0xFFFFFFFF)
+ if (opacity_ < Opacity::Opaque)
{
- if (opacity_ < 0xF3333333)
+ if (opacity_ < Opacity::Opaque - Opacity::MouseStep)
{
- setOpacity(true, opacity_ + 0xCCCCCCC);
custom_opacity = true;
+ setOpacity(opacity_ + Opacity::MouseStep);
}
else
{
- setOpacity(false, 0xFFFFFFFF);
- custom_opacity = false;
+ if (defaultOpacity() == Opacity::Opaque)
+ custom_opacity = false;
+ setOpacity(Opacity::Opaque);
}
}
break;
case Options::MouseOpacityLess:
- if (opacity_ > 0)
+ if (opacity_ > Opacity::Transparent)
{
- setOpacity(true, (opacity_ > 0xCCCCCCC) ? opacity_ - 0xCCCCCCC : 0);
custom_opacity = true;
+ setOpacity((opacity_ > Opacity::MouseStep) ? opacity_ - Opacity::MouseStep : Opacity::Transparent);
}
break;
case Options::MouseNothing: