mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
fix(capslockindicator): Fix position of capslock indicator
This commit is contained in:
parent
d7da2f98c0
commit
124769017d
|
@ -5,17 +5,24 @@
|
|||
|
||||
CapsLockIndicator::CapsLockIndicator(QWidget *parent) : QToolButton(parent)
|
||||
{
|
||||
inputSize = QSize(130, 23);
|
||||
cleanInputStyle = parentWidget()->styleSheet();
|
||||
|
||||
QIcon icon = QIcon(":img/caps_lock.svg");
|
||||
setIcon(icon);
|
||||
QSize iconSize(inputSize.height(), inputSize.height());
|
||||
setIconSize(iconSize);
|
||||
setCursor(Qt::ArrowCursor);
|
||||
move(inputSize.width() - inputSize.height(), 0);
|
||||
setStyleSheet("border: none; padding: 0; color: white");
|
||||
setToolTip(tr("CAPS-LOCK ENABLED"));
|
||||
updateSize();
|
||||
}
|
||||
|
||||
void CapsLockIndicator::updateSize()
|
||||
{
|
||||
inputSize = parentWidget()->size();
|
||||
move(inputSize.width() - inputSize.height(), 0);
|
||||
|
||||
int side = inputSize.height() - 5;
|
||||
QSize iconSize(side, side);
|
||||
setIconSize(iconSize);
|
||||
}
|
||||
|
||||
void CapsLockIndicator::show()
|
||||
|
|
|
@ -8,6 +8,7 @@ class CapsLockIndicator : QToolButton
|
|||
public:
|
||||
CapsLockIndicator(QWidget *widget);
|
||||
void updateIndicator();
|
||||
void updateSize();
|
||||
|
||||
private:
|
||||
void show();
|
||||
|
|
|
@ -136,6 +136,8 @@ bool LoginScreen::event(QEvent* event)
|
|||
void LoginScreen::onNewProfilePageClicked()
|
||||
{
|
||||
ui->stackedWidget->setCurrentIndex(0);
|
||||
capsIndicator->updateSize();
|
||||
confimCapsIndicator->updateSize();
|
||||
}
|
||||
|
||||
void LoginScreen::onLoginPageClicked()
|
||||
|
|
Loading…
Reference in New Issue
Block a user