mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 10:39:18 +02:00
gtk: simplify UpdateStatusBarPanel and reduce gtk warings in console
git-svn-id: trunk@12582 -
This commit is contained in:
parent
72c2520711
commit
cdad49e2bd
@ -25,8 +25,8 @@ uses
|
|||||||
{$ELSE}
|
{$ELSE}
|
||||||
glib, gdk, gtk,
|
glib, gdk, gtk,
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
LMessages, LCLProc, Controls, Forms, LCLIntf, LCLType, GTKDef, DynHashArray,
|
LMessages, LCLProc, Controls, ComCtrls, Forms, LCLIntf, LCLType, GTKDef,
|
||||||
Maps;
|
DynHashArray, Maps;
|
||||||
|
|
||||||
{$I dragicons.inc}
|
{$I dragicons.inc}
|
||||||
|
|
||||||
@ -391,10 +391,24 @@ var
|
|||||||
|
|
||||||
const
|
const
|
||||||
aGtkJustification: array[TAlignment] of TGTKJustification =
|
aGtkJustification: array[TAlignment] of TGTKJustification =
|
||||||
(GTK_JUSTIFY_LEFT,GTK_JUSTIFY_RIGHT,GTK_JUSTIFY_CENTER);
|
(
|
||||||
|
{taLeftJustify } GTK_JUSTIFY_LEFT,
|
||||||
|
{taRightJustify} GTK_JUSTIFY_RIGHT,
|
||||||
|
{taCenter } GTK_JUSTIFY_CENTER
|
||||||
|
);
|
||||||
|
|
||||||
aGtkSelectionMode: Array[Boolean] of TGtkSelectionMode =
|
aGtkSelectionMode: array[Boolean] of TGtkSelectionMode =
|
||||||
(GTK_SELECTION_SINGLE,GTk_SELECTION_EXTENDED);
|
(
|
||||||
|
GTK_SELECTION_SINGLE,
|
||||||
|
GTK_SELECTION_EXTENDED
|
||||||
|
);
|
||||||
|
|
||||||
|
aGtkShadowFromBevel: array[TStatusPanelBevel] of TGtkShadowType =
|
||||||
|
(
|
||||||
|
{ pbNone } GTK_SHADOW_NONE,
|
||||||
|
{ pbLowered } GTK_SHADOW_IN,
|
||||||
|
{ pbRaised } GTK_SHADOW_OUT
|
||||||
|
);
|
||||||
|
|
||||||
{ file dialog }
|
{ file dialog }
|
||||||
|
|
||||||
|
@ -6384,32 +6384,25 @@ begin
|
|||||||
|
|
||||||
|
|
||||||
// Alignment
|
// Alignment
|
||||||
if CurPanel<>nil then begin
|
if CurPanel<>nil then
|
||||||
|
begin
|
||||||
//DebugLn(' Alignment="',ord(CurPanel.Alignment),'"');
|
//DebugLn(' Alignment="',ord(CurPanel.Alignment),'"');
|
||||||
case CurPanel.Alignment of
|
NewJustification := aGtkJustification[CurPanel.Alignment];
|
||||||
taLeftJustify: NewJustification:=GTK_JUSTIFY_LEFT;
|
if GTK_IS_LABEL(LabelWidget) then
|
||||||
taRightJustify: NewJustification:=GTK_JUSTIFY_RIGHT;
|
|
||||||
taCenter: NewJustification:=GTK_JUSTIFY_CENTER;
|
|
||||||
else
|
|
||||||
NewJustification:=GTK_JUSTIFY_LEFT;
|
|
||||||
end;
|
|
||||||
gtk_label_set_justify(LabelWidget, NewJustification);
|
gtk_label_set_justify(LabelWidget, NewJustification);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// Bevel
|
// Bevel
|
||||||
if CurPanel<>nil then begin
|
if CurPanel<>nil then
|
||||||
case CurPanel.Bevel of
|
begin
|
||||||
pbNone: NewShadowType:=GTK_SHADOW_NONE;
|
NewShadowType := aGtkShadowFromBevel[CurPanel.Bevel];
|
||||||
pbLowered: NewShadowType:=GTK_SHADOW_IN;
|
if GTK_IS_FRAME(FrameWidget) then
|
||||||
pbRaised: NewShadowType:=GTK_SHADOW_OUT;
|
|
||||||
else
|
|
||||||
NewShadowType:=GTK_SHADOW_IN;
|
|
||||||
end;
|
|
||||||
gtk_frame_set_shadow_type(PGtkFrame(FrameWidget), NewShadowType);
|
gtk_frame_set_shadow_type(PGtkFrame(FrameWidget), NewShadowType);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// Width
|
// Width
|
||||||
if (CurPanel<>nil) then begin
|
if (CurPanel<>nil) then
|
||||||
|
begin
|
||||||
//DebugLn(' CurPanel.Width="',CurPanel.Width,'"');
|
//DebugLn(' CurPanel.Width="',CurPanel.Width,'"');
|
||||||
gtk_widget_set_usize(StatusPanelWidget,CurPanel.Width,
|
gtk_widget_set_usize(StatusPanelWidget,CurPanel.Width,
|
||||||
StatusPanelWidget^.allocation.height);
|
StatusPanelWidget^.allocation.height);
|
||||||
|
Loading…
Reference in New Issue
Block a user