File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -73,6 +73,10 @@ namespace {
7373 constexpr std::size_t kUndoStackLimit = 100 ;
7474 constexpr auto kTypingUndoCoalesceWindow = std::chrono::milliseconds(1000 );
7575
76+ float chromeScaleForControlHeight (float controlHeight) noexcept {
77+ return std::max (0 .1f , controlHeight / Style::controlHeight);
78+ }
79+
7680 bool isWordCodepoint (const std::string& text, std::size_t bytePos) {
7781 if (bytePos >= text.size ()) {
7882 return false ;
@@ -781,6 +785,7 @@ void Input::applyVisualState() {
781785 const bool clearButtonHovered = m_clearButtonArea != nullptr && m_clearButtonArea->hovered ();
782786 const bool inputHovered = (m_inputArea != nullptr && m_inputArea->hovered ()) || clearButtonHovered;
783787 const bool readOnly = isReadOnlyVisual ();
788+ const float chromeScale = chromeScaleForControlHeight (m_controlHeight);
784789
785790 if (m_frameVisible) {
786791 m_background->setVisible (true );
@@ -794,7 +799,7 @@ void Input::applyVisualState() {
794799 .fill = fill,
795800 .border = border,
796801 .fillMode = FillMode::Solid,
797- .radius = Style::scaledRadiusMd (),
802+ .radius = Style::scaledRadiusMd (chromeScale ),
798803 .softness = 1 .0f ,
799804 .borderWidth = Style::borderWidth,
800805 });
You can’t perform that action at this time.
0 commit comments