Slight redesign of hidden profile number
This commit is contained in:
parent
a45d80b8d7
commit
423356d42c
2 changed files with 13 additions and 4 deletions
|
|
@ -113,6 +113,11 @@ mainMenuResetScaleIconLeft: 5px;
|
||||||
mainMenuCoverTextLeft: 30px;
|
mainMenuCoverTextLeft: 30px;
|
||||||
mainMenuCoverNameTop: 84px;
|
mainMenuCoverNameTop: 84px;
|
||||||
mainMenuCoverStatusTop: 102px;
|
mainMenuCoverStatusTop: 102px;
|
||||||
|
mainMenuCoverNameOnlyTop: 94px;
|
||||||
|
mainMenuCoverNameOnlyFont: font(14px semibold);
|
||||||
|
mainMenuCoverNameOnlyStyle: TextStyle(semiboldTextStyle) {
|
||||||
|
font: mainMenuCoverNameOnlyFont;
|
||||||
|
}
|
||||||
mainMenuSkip: 13px;
|
mainMenuSkip: 13px;
|
||||||
mainMenu: Menu(defaultMenu) {
|
mainMenu: Menu(defaultMenu) {
|
||||||
itemFg: windowBoldFg;
|
itemFg: windowBoldFg;
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "ui/widgets/menu.h"
|
#include "ui/widgets/menu.h"
|
||||||
#include "ui/widgets/popup_menu.h"
|
#include "ui/widgets/popup_menu.h"
|
||||||
#include "ui/text/text_utilities.h"
|
#include "ui/text/text_utilities.h"
|
||||||
|
#include "ui/text_options.h"
|
||||||
#include "ui/special_buttons.h"
|
#include "ui/special_buttons.h"
|
||||||
#include "ui/empty_userpic.h"
|
#include "ui/empty_userpic.h"
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
|
|
@ -418,8 +419,8 @@ void MainMenu::paintEvent(QPaintEvent *e) {
|
||||||
p.fillRect(cover, st::mainMenuCoverBg);
|
p.fillRect(cover, st::mainMenuCoverBg);
|
||||||
}
|
}
|
||||||
p.setPen(st::mainMenuCoverFg);
|
p.setPen(st::mainMenuCoverFg);
|
||||||
p.setFont(st::semiboldFont);
|
|
||||||
if (cShowPhoneInDrawer()) {
|
if (cShowPhoneInDrawer()) {
|
||||||
|
p.setFont(st::semiboldFont);
|
||||||
_controller->session().user()->nameText().drawLeftElided(
|
_controller->session().user()->nameText().drawLeftElided(
|
||||||
p,
|
p,
|
||||||
st::mainMenuCoverTextLeft,
|
st::mainMenuCoverTextLeft,
|
||||||
|
|
@ -429,11 +430,14 @@ void MainMenu::paintEvent(QPaintEvent *e) {
|
||||||
p.setFont(st::normalFont);
|
p.setFont(st::normalFont);
|
||||||
p.drawTextLeft(st::mainMenuCoverTextLeft, st::mainMenuCoverStatusTop, width(), _phoneText);
|
p.drawTextLeft(st::mainMenuCoverTextLeft, st::mainMenuCoverStatusTop, width(), _phoneText);
|
||||||
} else {
|
} else {
|
||||||
const auto diff = st::mainMenuCoverStatusTop - st::mainMenuCoverNameTop;
|
p.setFont(st::mainMenuCoverNameOnlyFont);
|
||||||
_controller->session().user()->nameText().drawLeftElided(
|
auto name = _controller->session().user()->nameText().toString();
|
||||||
|
auto nameStr = Ui::Text::String();
|
||||||
|
nameStr.setText(st::mainMenuCoverNameOnlyStyle, name, Ui::NameTextOptions());
|
||||||
|
nameStr.drawLeftElided(
|
||||||
p,
|
p,
|
||||||
st::mainMenuCoverTextLeft,
|
st::mainMenuCoverTextLeft,
|
||||||
st::mainMenuCoverNameTop + (diff / 2),
|
st::mainMenuCoverNameOnlyTop,
|
||||||
widthText,
|
widthText,
|
||||||
width());
|
width());
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue