summaryrefslogtreecommitdiff
path: root/chromium/ui/views/controls/label.cc
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-12 14:27:29 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-13 09:35:20 +0000
commitc30a6232df03e1efbd9f3b226777b07e087a1122 (patch)
treee992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/ui/views/controls/label.cc
parent7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff)
downloadqtwebengine-chromium-85-based.tar.gz
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/ui/views/controls/label.cc')
-rw-r--r--chromium/ui/views/controls/label.cc25
1 files changed, 23 insertions, 2 deletions
diff --git a/chromium/ui/views/controls/label.cc b/chromium/ui/views/controls/label.cc
index ad6af149e28..febce15ff86 100644
--- a/chromium/ui/views/controls/label.cc
+++ b/chromium/ui/views/controls/label.cc
@@ -108,6 +108,19 @@ int Label::GetTextContext() const {
return text_context_;
}
+int Label::GetTextStyle() const {
+ return text_style_;
+}
+
+void Label::SetTextStyle(int style) {
+ if (style == text_style_)
+ return;
+
+ text_style_ = style;
+ UpdateColorsFromTheme();
+ OnPropertyChanged(&text_style_, kPropertyEffectsPreferredSizeChanged);
+}
+
bool Label::GetAutoColorReadabilityEnabled() const {
return auto_color_readability_enabled_;
}
@@ -291,6 +304,14 @@ void Label::SetAllowCharacterBreak(bool allow_character_break) {
kPropertyEffectsLayout);
}
+size_t Label::GetTextIndexOfLine(size_t line) const {
+ return full_text_->GetTextIndexOfLine(line);
+}
+
+void Label::SetTruncateLength(size_t truncate_length) {
+ return full_text_->set_truncate_length(truncate_length);
+}
+
gfx::ElideBehavior Label::GetElideBehavior() const {
return elide_behavior_;
}
@@ -950,7 +971,6 @@ void Label::Init(const base::string16& text,
full_text_->SetCursorEnabled(false);
full_text_->SetWordWrapBehavior(gfx::TRUNCATE_LONG_WORDS);
- UpdateColorsFromTheme();
SetText(text);
// Only selectable labels will get requests to show the context menu, due to
@@ -1102,8 +1122,9 @@ void Label::BuildContextMenuContents() {
BEGIN_METADATA(Label)
METADATA_PARENT_CLASS(View)
-ADD_PROPERTY_METADATA(Label, bool, AutoColorReadabilityEnabled)
ADD_PROPERTY_METADATA(Label, base::string16, Text)
+ADD_PROPERTY_METADATA(Label, int, TextStyle)
+ADD_PROPERTY_METADATA(Label, bool, AutoColorReadabilityEnabled)
ADD_PROPERTY_METADATA(Label, SkColor, EnabledColor)
ADD_PROPERTY_METADATA(Label, gfx::ElideBehavior, ElideBehavior)
ADD_PROPERTY_METADATA(Label, SkColor, BackgroundColor)