Simplify TextStyle: remove linkFont/linkFontOver.
This commit is contained in:
parent
45ffbdeef9
commit
44f8d862ff
5 changed files with 23 additions and 30 deletions
|
|
@ -21,11 +21,17 @@ TextPalette {
|
||||||
|
|
||||||
TextStyle {
|
TextStyle {
|
||||||
font: font;
|
font: font;
|
||||||
linkFont: font;
|
linkUnderline: int;
|
||||||
linkFontOver: font;
|
blockPadding: margins;
|
||||||
|
blockOutline: pixels;
|
||||||
|
preScrollable: bool;
|
||||||
lineHeight: pixels;
|
lineHeight: pixels;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
kLinkUnderlineNever: 0;
|
||||||
|
kLinkUnderlineActive: 1;
|
||||||
|
kLinkUnderlineAlways: 2;
|
||||||
|
|
||||||
fsize: 13px;
|
fsize: 13px;
|
||||||
normalFont: font(fsize);
|
normalFont: font(fsize);
|
||||||
semiboldFont: font(fsize semibold);
|
semiboldFont: font(fsize semibold);
|
||||||
|
|
@ -50,14 +56,14 @@ defaultTextPalette: TextPalette {
|
||||||
}
|
}
|
||||||
defaultTextStyle: TextStyle {
|
defaultTextStyle: TextStyle {
|
||||||
font: normalFont;
|
font: normalFont;
|
||||||
linkFont: normalFont;
|
linkUnderline: kLinkUnderlineActive;
|
||||||
linkFontOver: font(fsize underline);
|
blockPadding: margins(10px, 4px, 6px, 4px);
|
||||||
|
blockOutline: 3px;
|
||||||
|
preScrollable: true;
|
||||||
lineHeight: 0px;
|
lineHeight: 0px;
|
||||||
}
|
}
|
||||||
semiboldTextStyle: TextStyle(defaultTextStyle) {
|
semiboldTextStyle: TextStyle(defaultTextStyle) {
|
||||||
font: semiboldFont;
|
font: semiboldFont;
|
||||||
linkFont: semiboldFont;
|
|
||||||
linkFontOver: font(fsize semibold underline);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
slideDuration: 240;
|
slideDuration: 240;
|
||||||
|
|
@ -69,7 +75,7 @@ fadeWrapDuration: 200;
|
||||||
|
|
||||||
linkCropLimit: 360px;
|
linkCropLimit: 360px;
|
||||||
linkFont: normalFont;
|
linkFont: normalFont;
|
||||||
linkOverFont: font(fsize underline);
|
linkFontOver: font(fsize underline);
|
||||||
|
|
||||||
roundRadiusLarge: 6px;
|
roundRadiusLarge: 6px;
|
||||||
roundRadiusSmall: 3px;
|
roundRadiusSmall: 3px;
|
||||||
|
|
|
||||||
|
|
@ -82,8 +82,6 @@ boxTitle: FlatLabel(defaultFlatLabel) {
|
||||||
maxHeight: 24px;
|
maxHeight: 24px;
|
||||||
style: TextStyle(defaultTextStyle) {
|
style: TextStyle(defaultTextStyle) {
|
||||||
font: boxTitleFont;
|
font: boxTitleFont;
|
||||||
linkFont: boxTitleFont;
|
|
||||||
linkFontOver: font(16px semibold underline);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
boxTitlePosition: point(24px, 18px);
|
boxTitlePosition: point(24px, 18px);
|
||||||
|
|
@ -187,8 +185,6 @@ separatePanelTitle: FlatLabel(defaultFlatLabel) {
|
||||||
maxHeight: 26px;
|
maxHeight: 26px;
|
||||||
style: TextStyle(defaultTextStyle) {
|
style: TextStyle(defaultTextStyle) {
|
||||||
font: separatePanelTitleFont;
|
font: separatePanelTitleFont;
|
||||||
linkFont: separatePanelTitleFont;
|
|
||||||
linkFontOver: font(18px semibold underline);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
separatePanelTitleTop: 18px;
|
separatePanelTitleTop: 18px;
|
||||||
|
|
|
||||||
|
|
@ -88,8 +88,6 @@ void TitleWidget::init(int height) {
|
||||||
const auto setFromFont = [&](const style::font &font) {
|
const auto setFromFont = [&](const style::font &font) {
|
||||||
_textStyle = std::make_unique<style::TextStyle>(style::TextStyle{
|
_textStyle = std::make_unique<style::TextStyle>(style::TextStyle{
|
||||||
.font = font,
|
.font = font,
|
||||||
.linkFont = font,
|
|
||||||
.linkFontOver = font,
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1410,11 +1410,14 @@ void Renderer::eSetFont(const AbstractBlock *block) {
|
||||||
const auto flags = block->flags();
|
const auto flags = block->flags();
|
||||||
const auto usedFont = [&] {
|
const auto usedFont = [&] {
|
||||||
if (const auto index = block->linkIndex()) {
|
if (const auto index = block->linkIndex()) {
|
||||||
const auto active = (_palette && _palette->linkAlwaysActive)
|
const auto underline = _t->_st->linkUnderline;
|
||||||
|| ClickHandler::showAsActive(_t->_links.at(index - 1));
|
const auto underlined = (underline == st::kLinkUnderlineNever)
|
||||||
return active
|
? false
|
||||||
? _t->_st->linkFontOver
|
: (underline == st::kLinkUnderlineActive)
|
||||||
: _t->_st->linkFont;
|
? ((_palette && _palette->linkAlwaysActive)
|
||||||
|
|| ClickHandler::showAsActive(_t->_links.at(index - 1)))
|
||||||
|
: true;
|
||||||
|
return underlined ? _t->_st->font->underline() : _t->_st->font;
|
||||||
}
|
}
|
||||||
return _t->_st->font;
|
return _t->_st->font;
|
||||||
}();
|
}();
|
||||||
|
|
|
||||||
|
|
@ -641,7 +641,7 @@ defaultLinkButton: LinkButton {
|
||||||
color: windowActiveTextFg;
|
color: windowActiveTextFg;
|
||||||
overColor: windowActiveTextFg;
|
overColor: windowActiveTextFg;
|
||||||
font: linkFont;
|
font: linkFont;
|
||||||
overFont: linkOverFont;
|
overFont: linkFontOver;
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultRippleAnimation: RippleAnimation {
|
defaultRippleAnimation: RippleAnimation {
|
||||||
|
|
@ -1145,8 +1145,6 @@ defaultImportantTooltip: ImportantTooltip {
|
||||||
defaultImportantTooltipLabel: FlatLabel(defaultFlatLabel) {
|
defaultImportantTooltipLabel: FlatLabel(defaultFlatLabel) {
|
||||||
style: TextStyle(defaultTextStyle) {
|
style: TextStyle(defaultTextStyle) {
|
||||||
font: font(11px);
|
font: font(11px);
|
||||||
linkFont: font(11px);
|
|
||||||
linkFontOver: font(11px underline);
|
|
||||||
}
|
}
|
||||||
textFg: importantTooltipFg;
|
textFg: importantTooltipFg;
|
||||||
palette: TextPalette(defaultTextPalette) {
|
palette: TextPalette(defaultTextPalette) {
|
||||||
|
|
@ -1252,11 +1250,7 @@ defaultPeerListItem: PeerListItem {
|
||||||
height: 58px;
|
height: 58px;
|
||||||
photoPosition: point(12px, 6px);
|
photoPosition: point(12px, 6px);
|
||||||
namePosition: point(68px, 11px);
|
namePosition: point(68px, 11px);
|
||||||
nameStyle: TextStyle(defaultTextStyle) {
|
nameStyle: semiboldTextStyle;
|
||||||
font: semiboldFont;
|
|
||||||
linkFont: semiboldFont;
|
|
||||||
linkFontOver: semiboldFont;
|
|
||||||
}
|
|
||||||
nameFg: contactsNameFg;
|
nameFg: contactsNameFg;
|
||||||
nameFgChecked: windowActiveTextFg;
|
nameFgChecked: windowActiveTextFg;
|
||||||
statusPosition: point(68px, 31px);
|
statusPosition: point(68px, 31px);
|
||||||
|
|
@ -1271,8 +1265,6 @@ defaultPeerListItem: PeerListItem {
|
||||||
|
|
||||||
boxTextStyle: TextStyle(defaultTextStyle) {
|
boxTextStyle: TextStyle(defaultTextStyle) {
|
||||||
font: font(boxFontSize);
|
font: font(boxFontSize);
|
||||||
linkFont: font(boxFontSize);
|
|
||||||
linkFontOver: font(boxFontSize underline);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultPeerListAbout: FlatLabel(defaultFlatLabel) {
|
defaultPeerListAbout: FlatLabel(defaultFlatLabel) {
|
||||||
|
|
@ -1437,8 +1429,6 @@ defaultWindowTitle: WindowTitle {
|
||||||
fgActive: titleFgActive;
|
fgActive: titleFgActive;
|
||||||
style: TextStyle(defaultTextStyle) {
|
style: TextStyle(defaultTextStyle) {
|
||||||
font: font(semibold 12px);
|
font: font(semibold 12px);
|
||||||
linkFont: font(semibold 12px);
|
|
||||||
linkFontOver: font(semibold 12px underline);
|
|
||||||
}
|
}
|
||||||
minimize: IconButton(windowTitleButton) {
|
minimize: IconButton(windowTitleButton) {
|
||||||
icon: icon {
|
icon: icon {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue