Gtk3: added more system metrics.

This commit is contained in:
zeljan1 2025-01-16 13:25:22 +01:00
parent 1f5b7cdd2f
commit 4c39c0d55f
2 changed files with 11 additions and 1 deletions

View File

@ -403,6 +403,7 @@ var
MinH,PrefH:gint;
window:PGtkWindow;
box:PGtkBox;
header:PGtkHeaderBar;
begin
{$IFDEF GTK3DEBUGCORE}
DebugLn('TGtk3WidgetSet.AppInit');
@ -442,6 +443,9 @@ begin
scrollBarV := gtk_scrollbar_new(GTK_ORIENTATION_VERTICAL, nil);
gtk_box_pack_start(box, scrollBarV, FALSE, FALSE, 0);
header := gtk_header_bar_new;
gtk_box_pack_start(box, header, False, False, 0);
gtk_widget_show_all(window);
// This is usually not needed, but in case metrics aren't created properly
@ -475,6 +479,9 @@ begin
scrollBarV^.get_preferred_width(@MinH, @PrefH);
FSystemMetricsList.Items[SM_CXVSCROLL] := Max(MinH, PrefH);
header^.get_preferred_height(@MinH, @PrefH);
FSystemMetricsList.Items[SM_CYCAPTION] := Max(MinH, PrefH);
gtk_widget_destroy(window);
end;

View File

@ -2719,6 +2719,8 @@ begin
gdk_screen_get_monitor_workarea(ascreen, 0, @ARect);
Result := ARect.height;
end;
SM_CXSIZEFRAME, SM_CYSIZEFRAME,
SM_CXFIXEDFRAME, SM_CYFIXEDFRAME: Result := 4; //TODO
SM_CYMENU,
SM_CXMENUSIZE,
SM_CYMENUSIZE,
@ -2727,7 +2729,8 @@ begin
SM_CXHSCROLL,
SM_CYHSCROLL,
SM_CXVSCROLL,
SM_CYVSCROLL:
SM_CYVSCROLL,
SM_CYCAPTION:
Result := SystemMetric(nIndex);
SM_CXFULLSCREEN,