mirror of
https://github.com/hyprwm/hyprlock.git
synced 2026-05-09 06:18:01 +02:00
add show and center options
This commit is contained in:
parent
8bd246c397
commit
801491a190
2 changed files with 5 additions and 4 deletions
|
|
@ -260,8 +260,7 @@ bool CPasswordInputField::draw(const SRenderData& data) {
|
|||
g_pRenderer->renderRect(inputFieldBox, innerCol, ROUND);
|
||||
|
||||
if (!hiddenInputState.enabled) {
|
||||
|
||||
if (false) {
|
||||
if (!password.show) {
|
||||
const int RECTPASSSIZE = std::nearbyint(inputFieldBox.h * dots.size * 0.5f) * 2.f;
|
||||
Vector2D passSize{RECTPASSSIZE, RECTPASSSIZE};
|
||||
int passSpacing = std::floor(passSize.x * dots.spacing);
|
||||
|
|
@ -331,7 +330,7 @@ bool CPasswordInputField::draw(const SRenderData& data) {
|
|||
if (password.asset != nullptr) {
|
||||
auto size = password.asset->texture.m_vSize;
|
||||
|
||||
double xstart = inputFieldBox.w / 2.0 - size.x / 2.0;
|
||||
double xstart = password.center ? inputFieldBox.w / 2.0 - size.x / 2.0 : inputFieldBox.h / 2.0 - size.y / 2.0;
|
||||
|
||||
Vector2D dotPosition = inputFieldBox.pos() + Vector2D{xstart, (inputFieldBox.h / 2.0) - (size.y / 2.0)};
|
||||
CBox box{dotPosition, Vector2D(size.x, size.y)};
|
||||
|
|
|
|||
|
|
@ -71,7 +71,9 @@ class CPasswordInputField : public IWidget {
|
|||
} dots;
|
||||
|
||||
struct {
|
||||
float size = 0;
|
||||
bool show = true;
|
||||
bool center = false;
|
||||
float size = 0;
|
||||
std::string content;
|
||||
std::string resourceID;
|
||||
SPreloadedAsset* asset = nullptr;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue