Kaydet (Commit) 17307a10 authored tarafından Colomban Wendling's avatar Colomban Wendling Kaydeden (comit) Caolán McNamara

tdf#105415 Use the system caret width on GTK

Change-Id: I6b7fc9d06a49613cc6fe247b44c56f36935082fa
Reviewed-on: https://gerrit.libreoffice.org/35282Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst bdaa13a8
......@@ -4108,6 +4108,12 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
aStyleSet.SetTitleFont( aFont );
aStyleSet.SetFloatTitleFont( aFont );
// Cursor width
gfloat caretAspectRatio = 0.04f;
gtk_widget_style_get( gWidgetData[m_nXScreen].gEditBoxWidget, "cursor-aspect-ratio", &caretAspectRatio, nullptr );
// Assume 20px tall for the ratio computation, which should give reasonable results
aStyleSet.SetCursorSize( 20 * caretAspectRatio + 1 );
// get cursor blink time
gboolean blink = false;
......
......@@ -2564,6 +2564,12 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
// This baby is the default page/paper color
aStyleSet.SetWindowColor( aBackFieldColor );
// Cursor width
gfloat caretAspectRatio = 0.04f;
gtk_style_context_get_style( pCStyle, "cursor-aspect-ratio", &caretAspectRatio, nullptr );
// Assume 20px tall for the ratio computation, which should give reasonable results
aStyleSet.SetCursorSize( 20 * caretAspectRatio + 1 );
// Dark shadow color
style_context_set_state(pCStyle, GTK_STATE_FLAG_INSENSITIVE);
gtk_style_context_get_color(pCStyle, gtk_style_context_get_state(pCStyle), &color);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment