gtk3: initialize syscolors

git-svn-id: trunk@55076 -
This commit is contained in:
zeljko 2017-05-24 20:38:53 +00:00
parent 49d6818b67
commit eb1d0abb53
2 changed files with 52 additions and 1 deletions

View File

@ -1013,6 +1013,31 @@ begin
StyleObject^.Widget := TGtkFixed.new;
lgs := lgsFrame;
end else
if CompareText(WName, LazGtkStyleNames[lgsVerticalScrollbar]) = 0 then
begin
StyleObject^.Widget := TGtkScrollbar.new(GTK_ORIENTATION_VERTICAL, nil);
lgs := lgsVerticalScrollbar;
end else
if CompareText(WName, LazGtkStyleNames[lgsHorizontalScrollbar]) = 0 then
begin
StyleObject^.Widget := TGtkScrollbar.new(GTK_ORIENTATION_HORIZONTAL, nil);
lgs := lgsHorizontalScrollbar;
end else
if CompareText(WName, LazGtkStyleNames[lgsMenuBar]) = 0 then
begin
StyleObject^.Widget := TGtkMenuBar.new;
lgs := lgsMenuBar;
end else
if CompareText(WName, LazGtkStyleNames[lgsMenu]) = 0 then
begin
StyleObject^.Widget := TGtkMenu.new;
lgs := lgsMenu;
end else
if CompareText(WName, LazGtkStyleNames[lgsMenuitem]) = 0 then
begin
StyleObject^.Widget := TGtkMenuItem.new;
lgs := lgsMenuItem;
end else
begin
end;
if Gtk3IsWidget(StyleObject^.Widget) then
@ -1028,6 +1053,9 @@ begin
//TODO: copy stuff from gtk2proc
UpdateSysColorMap(StyleObject^.Widget, lgs);
Result := StyleObject^.Widget;
end else
begin
// DebugLn('BUG: GetStyleWithName() created style is not GtkWidget ',WName);
end;
end;
end;

View File

@ -2469,6 +2469,28 @@ begin
{$IFDEF GTK3DEBUGNOTIMPLEMENTED}
writeln('TGtk3WidgetSet.GetSysColor WARNING: SOME SYSCOLORS ARE STILL HARDCODED nIndex=',nIndex);
{$ENDIF}
if (nIndex = COLOR_WINDOW) or (nIndex = COLOR_WINDOWTEXT) or
(nIndex = COLOR_HIGHLIGHT) or (nIndex = COLOR_HIGHLIGHTTEXT) then
GetStyleWidget(lgsMemo)
else
if (nIndex = COLOR_MENU) or (nIndex = COLOR_MENUHILIGHT) or
(nIndex = COLOR_MENUTEXT) then
begin
GetStyleWidget(lgsMenu);
GetStyleWidget(lgsMenuitem);
end else
if (nIndex = COLOR_MENUBAR) then
GetStyleWidget(lgsMenuBar)
else
if (nIndex = COLOR_SCROLLBAR) then
GetStyleWidget(lgsVerticalScrollbar)
else
if (nIndex = COLOR_BTNFACE) or (nIndex = COLOR_BTNTEXT) or
(nIndex = COLOR_BTNSHADOW) or (nIndex = COLOR_BTNHIGHLIGHT) then
GetStyleWidget(lgsButton)
else
if (nIndex = COLOR_BACKGROUND) or (nIndex = COLOR_FORM) then
GetStyleWidget(lgsWindow);
Result := SysColorMap[nIndex];
end;
@ -2483,9 +2505,10 @@ begin
Result := FSysColorBrushes[nIndex];
if Result = HBRUSH(-1) then
begin
DebugLn('WARNING: GetSysColorBrush SysColorBrushes arent''t initialized properly....');
InitSysColorBrushes;
Result := FSysColorBrushes[nIndex];
if Result = HBRUSH(-1) then
DebugLn('WARNING: GetSysColorBrush SysColorBrushes arent''t initialized properly....');
end;
end;
end;