diff --git a/src/dlangui/platforms/windows/win32fonts.d b/src/dlangui/platforms/windows/win32fonts.d index f8a1975c..14597b37 100644 --- a/src/dlangui/platforms/windows/win32fonts.d +++ b/src/dlangui/platforms/windows/win32fonts.d @@ -527,7 +527,7 @@ class Win32FontManager : FontManager { override ref FontRef getFont(int size, int weight, bool italic, FontFamily family, string face) { //Log.i("getFont()"); FontDef * def = findFace(family, face); - Log.i("getFont() found face ", def.face, " by requested face ", face); + //Log.i("getFont() found face ", def.face, " by requested face ", face); if (def !is null) { int index = _activeFonts.find(size, weight, italic, def.family, def.face); if (index >= 0) diff --git a/src/dlangui/widgets/lists.d b/src/dlangui/widgets/lists.d index b5980a52..7e492d6c 100644 --- a/src/dlangui/widgets/lists.d +++ b/src/dlangui/widgets/lists.d @@ -529,6 +529,10 @@ class ListWidget : WidgetGroup, OnScrollHandler { pwidth -= m.left + m.right + p.left + p.right; if (parentHeight != SIZE_UNSPECIFIED) pheight -= m.top + m.bottom + p.top + p.bottom; + + bool oldNeedLayout = _needLayout; + Visibility oldScrollbarVisibility = _scrollbar.visibility; + _scrollbar.visibility = Visibility.Visible; _scrollbar.measure(pwidth, pheight); @@ -606,6 +610,10 @@ class ListWidget : WidgetGroup, OnScrollHandler { } } measuredContent(parentWidth, parentHeight, sz.x + _sbsz.x, sz.y + _sbsz.y); + if (_scrollbar.visibility == oldScrollbarVisibility) { + _needLayout = oldNeedLayout; + _scrollbar.cancelLayout(); + } } @@ -715,6 +723,8 @@ class ListWidget : WidgetGroup, OnScrollHandler { makeSelectionVisible(); _makeSelectionVisibleOnNextLayout = false; } + _needLayout = false; + _scrollbar.cancelLayout(); } /// Draw widget at its position to buffer diff --git a/src/dlangui/widgets/menu.d b/src/dlangui/widgets/menu.d index dde271b2..2ef845c2 100644 --- a/src/dlangui/widgets/menu.d +++ b/src/dlangui/widgets/menu.d @@ -779,6 +779,12 @@ class MainMenu : MenuWidgetBase { deactivate(); } + /// request relayout of widget and its children + //override void requestLayout() { + // Log.d("MainMenu.requestLayout is called"); + // super.requestLayout(); + //} + /// bring focus to main menu, if not yet activated void activate() { debug(DebugMenus) Log.d("activating main menu"); diff --git a/src/dlangui/widgets/widget.d b/src/dlangui/widgets/widget.d index 24b81882..46c0088f 100644 --- a/src/dlangui/widgets/widget.d +++ b/src/dlangui/widgets/widget.d @@ -927,6 +927,10 @@ class Widget { } + void cancelLayout() { + _needLayout = false; + } + /// set new timer to call onTimer() after specified interval (for recurred notifications, return true from onTimer) ulong setTimer(long intervalMillis) { return window.setTimer(this, intervalMillis);