| 31 | ModifyUsernameDialog::~ModifyUsernameDialog() = default; |
| 32 | |
| 33 | void ModifyUsernameDialog::CreateLayout() { |
| 34 | setWindowTitle(tcTr("id_edit_username")); |
| 35 | |
| 36 | auto item_width = 320; |
| 37 | auto edit_size = QSize(item_width, 35); |
| 38 | |
| 39 | auto root_layout = new NoMarginHLayout(); |
| 40 | auto content_layout = new NoMarginVLayout(); |
| 41 | root_layout->addStretch(); |
| 42 | root_layout->addLayout(content_layout); |
| 43 | root_layout->addStretch(); |
| 44 | root_layout_->addLayout(root_layout); |
| 45 | |
| 46 | content_layout->addSpacing(25); |
| 47 | |
| 48 | // 1. username |
| 49 | { |
| 50 | auto layout = new NoMarginVLayout(); |
| 51 | auto label = new TcLabel(this); |
| 52 | label->setFixedWidth(item_width); |
| 53 | label->setStyleSheet(R"(color: #333333; font-weight: 700; font-size:13px;)"); |
| 54 | label->SetTextId("id_username"); |
| 55 | label->setAlignment(Qt::AlignLeft|Qt::AlignVCenter); |
| 56 | layout->addWidget(label); |
| 57 | layout->addSpacing(10); |
| 58 | |
| 59 | auto edit = new QLineEdit(this); |
| 60 | edt_username_ = edit; |
| 61 | edt_username_->setText(""); |
| 62 | |
| 63 | edit->setFixedSize(edit_size); |
| 64 | layout->addWidget(edit); |
| 65 | layout->addStretch(); |
| 66 | content_layout->addLayout(layout); |
| 67 | } |
| 68 | |
| 69 | content_layout->addStretch(); |
| 70 | |
| 71 | // sure button |
| 72 | { |
| 73 | auto layout = new NoMarginVLayout(); |
| 74 | auto btn_sure = new TcPushButton(); |
| 75 | btn_sure->SetTextId("id_ok"); |
| 76 | connect(btn_sure, &QPushButton::clicked, this, [=, this] () { |
| 77 | ModifyUsername(); |
| 78 | }); |
| 79 | |
| 80 | layout->addWidget(btn_sure); |
| 81 | btn_sure->setFixedSize(QSize(item_width, 35)); |
| 82 | |
| 83 | content_layout->addLayout(layout); |
| 84 | } |
| 85 | |
| 86 | content_layout->addSpacing(60); |
| 87 | } |
| 88 | |
| 89 | void ModifyUsernameDialog::paintEvent(QPaintEvent *event) { |
| 90 | TcCustomTitleBarDialog::paintEvent(event); |
nothing calls this directly
no outgoing calls
no test coverage detected