mirror of https://github.com/qTox/qTox.git
Browse Source
Fix altering the Line Edit widget height when the indicator is on (e.g. when caps lock is active). To avoid messing with the style and all the complex issues that arise from it, use an action to display the icon inside the line edit, as it is a built-in feature that work just fine. Fixes #3379.pull/3383/head
3 changed files with 11 additions and 46 deletions
@ -1,21 +1,16 @@
@@ -1,21 +1,16 @@
|
||||
#ifndef CAPSLOCKINDICATOR_H |
||||
#define CAPSLOCKINDICATOR_H |
||||
|
||||
#include <QToolButton> |
||||
#include <QAction> |
||||
#include <QLineEdit> |
||||
|
||||
class CapsLockIndicator : QToolButton |
||||
class CapsLockIndicator : QAction |
||||
{ |
||||
public: |
||||
CapsLockIndicator(QWidget *widget); |
||||
CapsLockIndicator(QLineEdit *widget); |
||||
void updateIndicator(); |
||||
void updateSize(); |
||||
|
||||
private: |
||||
void show(); |
||||
void hide(); |
||||
|
||||
private: |
||||
QString cleanInputStyle; |
||||
QSize inputSize; |
||||
QLineEdit *parent; |
||||
}; |
||||
#endif // CAPSLOCKINDICATOR_H
|
||||
|
Loading…
Reference in new issue