-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(capslockindicator): fix altering the line edit height
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 qTox#3379.
- Loading branch information
Showing
3 changed files
with
11 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters