mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-09 23:59:56 +02:00
LCL: setBidiMode in CreateWnd, so all ws are correctly updated.fixes #16818
git-svn-id: trunk@26365 -
This commit is contained in:
parent
fe2b7dfcaf
commit
985aea5d22
@ -7135,6 +7135,9 @@ begin
|
|||||||
if not HandleAllocated then
|
if not HandleAllocated then
|
||||||
RaiseGDBException('Handle creation failed creating '+DbgSName(Self));
|
RaiseGDBException('Handle creation failed creating '+DbgSName(Self));
|
||||||
//debugln('TWinControl.CreateWnd update constraints ... ',DbgSName(Self));
|
//debugln('TWinControl.CreateWnd update constraints ... ',DbgSName(Self));
|
||||||
|
TWSWinControlClass(WidgetSetClass).SetBiDiMode(Self,
|
||||||
|
UseRightToLeftAlignment, UseRightToLeftReading, UseRightToLeftScrollBar);
|
||||||
|
|
||||||
Constraints.UpdateInterfaceConstraints;
|
Constraints.UpdateInterfaceConstraints;
|
||||||
InvalidateClientRectCache(False);
|
InvalidateClientRectCache(False);
|
||||||
TWSWinControlClass(WidgetSetClass).ConstraintsChange(Self);
|
TWSWinControlClass(WidgetSetClass).ConstraintsChange(Self);
|
||||||
|
@ -242,19 +242,11 @@ class procedure TGtk2WSWinControl.SetBiDiMode(const AWinControl : TWinControl;
|
|||||||
const
|
const
|
||||||
WidgetDirection : array[boolean] of longint = (GTK_TEXT_DIR_LTR, GTK_TEXT_DIR_RTL);
|
WidgetDirection : array[boolean] of longint = (GTK_TEXT_DIR_LTR, GTK_TEXT_DIR_RTL);
|
||||||
begin
|
begin
|
||||||
gtk_widget_set_direction(PGtkWidget(AWinControl.Handle), WidgetDirection[UseRightToLeftAlign]);
|
if not WSCheckHandleAllocated(AWinControl, 'SetBiDiMode') then
|
||||||
|
Exit;
|
||||||
|
|
||||||
if UseRightToLeftReading then // By default GTK2 support bidi regardless of the layout
|
gtk_widget_set_direction(PGtkWidget(AWinControl.Handle),
|
||||||
begin
|
WidgetDirection[UseRightToLeftAlign]);
|
||||||
end
|
|
||||||
else begin
|
|
||||||
end;
|
|
||||||
|
|
||||||
if UseRightToLeftScrollBar then // I don't know how to do it for now (if possible)
|
|
||||||
begin
|
|
||||||
end
|
|
||||||
else begin
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
@ -1611,8 +1611,7 @@ begin
|
|||||||
ChildOfComplexWidget := ccwNone;
|
ChildOfComplexWidget := ccwNone;
|
||||||
// creates the widget
|
// creates the widget
|
||||||
Widget := CreateWidget(FParams);
|
Widget := CreateWidget(FParams);
|
||||||
if LCLObject.BiDiMode = bdRightToLeft then
|
|
||||||
setLayoutDirection(QtRightToLeft);
|
|
||||||
// retrieve default cursor on create
|
// retrieve default cursor on create
|
||||||
FDefaultCursor := QCursor_create();
|
FDefaultCursor := QCursor_create();
|
||||||
QWidget_cursor(Widget, FDefaultCursor);
|
QWidget_cursor(Widget, FDefaultCursor);
|
||||||
|
Loading…
Reference in New Issue
Block a user