diff --git a/Freewood-OctoWoW-Core.toc b/Freewood-OctoWoW-Core.toc index 5440502..19a365d 100644 --- a/Freewood-OctoWoW-Core.toc +++ b/Freewood-OctoWoW-Core.toc @@ -3,7 +3,7 @@ ## Notes: Base addon of the Freewood family: data storage, UI kit, export/import and the main window. ## Notes-deDE: Basis-Addon der Freewood-Familie: Datenspeicher, UI-Bausteine, Export/Import und Hauptfenster. ## Author: Lacustat -## Version: 0.1.175 +## Version: 0.1.176 ## SavedVariables: FreewoodDB ## SavedVariablesPerCharacter: FreewoodCharDB diff --git a/UI/Tabs.lua b/UI/Tabs.lua index 5d77150..4a3f393 100644 --- a/UI/Tabs.lua +++ b/UI/Tabs.lua @@ -325,15 +325,8 @@ local function LeftWidth(W) end local layingOut, pendingLayout, layoutDepth = false, false, 0 -local function LayoutSections() - if not settingsBody then - return - end - if layingOut then - pendingLayout = true -- eine Hoehe hat sich waehrend des Anordnens geaendert: danach noch einmal - return - end - layingOut = true +local LayoutSections +local function DoLayout() local W = settingsBody:GetWidth() or 0 if W < 200 then W = 1000 @@ -349,7 +342,7 @@ local function LayoutSections() xs[i] = x0 + (i - 1) * (colW + SECTION_GAP) ypos[i] = 0 end - settingsLeft:SetShown(general) + if general then settingsLeft:Show() else settingsLeft:Hide() end settingsLeft:SetWidth(leftW) for _, def in ipairs(settingsSections) do local frame = def.frame @@ -398,7 +391,26 @@ local function LayoutSections() end end UpdateCatBar() +end + +LayoutSections = function() + if not settingsBody then + return + end + if layingOut then + pendingLayout = true -- eine Hoehe hat sich waehrend des Anordnens geaendert: danach noch einmal + return + end + layingOut = true + local ok, err = pcall(DoLayout) layingOut = false + if not ok then + pendingLayout = false + if DEFAULT_CHAT_FRAME then + DEFAULT_CHAT_FRAME:AddMessage("|cffff5555Freewood: Fehler in den Einstellungen: " .. tostring(err) .. "|r") + end + return + end if pendingLayout and layoutDepth < 4 then pendingLayout = false layoutDepth = layoutDepth + 1 @@ -457,6 +469,7 @@ local function BuildSettings(content) catBar:SetHeight(28) catButtons = {} for _, cat in ipairs(CATS) do + local cat = cat -- Lua 5.0: Schleifenvariable fuer die Closure sichern local b = UI.CreateButton(catBar, L[CAT_LABEL[cat]], 160, 26, function() SelectCategory(cat) end) b.cat = cat catButtons[#catButtons + 1] = b