Merge branch 'fix_scrollbars' into 'master'

Do not use deprecated MyGUI properties

Closes #5896

See merge request OpenMW/openmw!3320
macos_ci_fix
psi29a 1 year ago
commit ab798be320

@ -92,6 +92,7 @@
Feature #7284: Searching in the console with regex and toggleable case-sensitivity
Feature #7477: NegativeLight Magic Effect flag
Feature #7499: OpenMW-CS: Generate record filters by drag & dropping cell content to the filters field
Task #5896: Do not use deprecated MyGUI properties
Task #7113: Move from std::atoi to std::from_char
Task #7117: Replace boost::scoped_array with std::vector
Task #7151: Do not use std::strerror to get errno error message

@ -610,18 +610,26 @@ namespace Gui
void FontLoader::overrideLineHeight(MyGUI::xml::ElementPtr _node, const std::string& _file, MyGUI::Version _version)
{
// We should adjust line height for MyGUI widgets depending on font size
MyGUI::xml::ElementEnumerator resourceNode = _node->getElementEnumerator();
while (resourceNode.next("Resource"))
{
std::string type = resourceNode->findAttribute("type");
if (Misc::StringUtils::ciEqual(type, "ResourceSkin")
|| Misc::StringUtils::ciEqual(type, "AutoSizedResourceSkin"))
if (Misc::StringUtils::ciEqual(type, "ResourceLayout"))
{
// We should adjust line height for MyGUI widgets depending on font size
MyGUI::xml::ElementPtr heightNode = resourceNode->createChild("Property");
heightNode->addAttribute("key", "HeightLine");
heightNode->addAttribute("value", std::to_string(Settings::gui().mFontSize + 2));
MyGUI::xml::ElementEnumerator resourceRootNode = resourceNode->getElementEnumerator();
while (resourceRootNode.next("Widget"))
{
if (resourceRootNode->findAttribute("name") != "Root")
continue;
MyGUI::xml::ElementPtr heightNode = resourceRootNode->createChild("UserString");
heightNode->addAttribute("key", "HeightLine");
heightNode->addAttribute("value", std::to_string(Settings::gui().mFontSize + 2));
break;
}
}
}

@ -69,10 +69,6 @@ if(NOT OPENMW_USE_SYSTEM_MYGUI)
set(MYGUI_BUILD_PLUGINS OFF CACHE BOOL "")
set(MYGUI_BUILD_TOOLS OFF CACHE BOOL "")
# We appear to be using some obsolete properties in the XML.
# See https://gitlab.com/OpenMW/openmw/-/issues/5896
set(MYGUI_DONT_USE_OBSOLETE OFF CACHE BOOL "")
if(MYGUI_STATIC)
set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
else()

@ -59,51 +59,58 @@
</BasisSkin>
</Resource>
<Resource type="ResourceSkin" name="MW_EnergyBar_Magic" size="64 12">
<Property key="TrackSkin" value="MW_BarTrack_Magic"/>
<Property key="TrackFill" value="1"/>
<Child type="Widget" skin="MW_Box" offset="0 0 64 12" align="Stretch"/>
<Child type="Widget" skin="BlackBG" offset="2 2 60 8" align="Stretch" name="Client"/>
<Resource type="ResourceLayout" name="MW_EnergyBar_Magic" size="64 12">
<Widget type="Widget" position="0 0 64 12" name="Root">
<UserString key="TrackSkin" value="MW_BarTrack_Magic"/>
<UserString key="TrackFill" value="true"/>
<Widget type="Widget" skin="BlackBG" position="2 2 60 8" align="Stretch" name="Client" />
<Widget type="Widget" skin="MW_Box" position="0 0 64 12" align="Stretch" />
</Widget>
</Resource>
<Resource type="ResourceSkin" name="MW_EnergyBar_Weapon" size="64 12">
<Property key="TrackSkin" value="MW_BarTrack_Weapon"/>
<Property key="TrackFill" value="1"/>
<Child type="Widget" skin="MW_Box" offset="0 0 64 12" align="Stretch"/>
<Child type="Widget" skin="BlackBG" offset="2 2 60 8" align="Stretch" name="Client"/>
<Resource type="ResourceLayout" name="MW_EnergyBar_Weapon" size="64 12">
<Widget type="Widget" position="0 0 64 12" name="Root">
<UserString key="TrackSkin" value="MW_BarTrack_Weapon"/>
<UserString key="TrackFill" value="true"/>
<Widget type="Widget" skin="BlackBG" position="2 2 60 8" align="Stretch" name="Client" />
<Widget type="Widget" skin="MW_Box" position="0 0 64 12" align="Stretch" />
</Widget>
</Resource>
<Resource type="ResourceSkin" name="MW_EnergyBar_Red" size="64 12">
<Property key="TrackSkin" value="MW_BarTrack_Red"/>
<Property key="TrackFill" value="1"/>
<Child type="Widget" skin="MW_Box" offset="0 0 64 12" align="Stretch"/>
<Child type="Widget" skin="BlackBG" offset="2 2 60 8" align="Stretch" name="Client"/>
<Resource type="ResourceLayout" name="MW_EnergyBar_Red" size="64 12">
<Widget type="Widget" position="0 0 64 12" name="Root">
<UserString key="TrackSkin" value="MW_BarTrack_Red"/>
<UserString key="TrackFill" value="true"/>
<Widget type="Widget" skin="BlackBG" position="2 2 60 8" align="Stretch" name="Client" />
<Widget type="Widget" skin="MW_Box" position="0 0 64 12" align="Stretch" />
</Widget>
</Resource>
<Resource type="ResourceSkin" name="MW_EnergyBar_Green" size="64 12">
<Property key="TrackSkin" value="MW_BarTrack_Green"/>
<Property key="TrackFill" value="1"/>
<Child type="Widget" skin="MW_Box" offset="0 0 64 12" align="Stretch"/>
<Child type="Widget" skin="BlackBG" offset="2 2 60 8" align="Stretch" name="Client"/>
<Resource type="ResourceLayout" name="MW_EnergyBar_Green" size="64 12">
<Widget type="Widget" position="0 0 64 12" name="Root">
<UserString key="TrackSkin" value="MW_BarTrack_Green"/>
<UserString key="TrackFill" value="true"/>
<Widget type="Widget" skin="BlackBG" position="2 2 60 8" align="Stretch" name="Client" />
<Widget type="Widget" skin="MW_Box" position="0 0 64 12" align="Stretch" />
</Widget>
</Resource>
<Resource type="ResourceSkin" name="MW_EnergyBar_Blue" size="64 12">
<Property key="TrackSkin" value="MW_BarTrack_Blue"/>
<Property key="TrackFill" value="1"/>
<Child type="Widget" skin="MW_Box" offset="0 0 64 12" align="Stretch"/>
<Child type="Widget" skin="BlackBG" offset="2 2 60 8" align="Stretch" name="Client"/>
<Resource type="ResourceLayout" name="MW_EnergyBar_Blue" size="64 12">
<Widget type="Widget" position="0 0 64 12" name="Root">
<UserString key="TrackSkin" value="MW_BarTrack_Blue"/>
<UserString key="TrackFill" value="true"/>
<Widget type="Widget" skin="BlackBG" position="2 2 60 8" align="Stretch" name="Client" />
<Widget type="Widget" skin="MW_Box" position="0 0 64 12" align="Stretch" />
</Widget>
</Resource>
<Resource type="ResourceSkin" name="MW_EnergyBar_Yellow" size="64 12">
<Property key="TrackSkin" value="MW_BarTrack_Yellow"/>
<Property key="TrackFill" value="1"/>
<Child type="Widget" skin="MW_Box" offset="0 0 64 12" align="Stretch"/>
<Child type="Widget" skin="BlackBG" offset="2 2 60 8" align="Stretch" name="Client"/>
<Resource type="ResourceLayout" name="MW_EnergyBar_Yellow" size="64 12">
<Widget type="Widget" position="0 0 64 12" name="Root">
<UserString key="TrackSkin" value="MW_BarTrack_Yellow"/>
<UserString key="TrackFill" value="true"/>
<Widget type="Widget" skin="BlackBG" position="2 2 60 8" align="Stretch" name="Client" />
<Widget type="Widget" skin="MW_Box" position="0 0 64 12" align="Stretch" />
</Widget>
</Resource>
</MyGUI>

@ -4,39 +4,40 @@
<!-- Horizontal Scrollbar -->
<Resource type="ResourceSkin" name="MW_HScroll" size="90 14">
<Property key="TrackRangeMargins" value="20 19"/>
<Property key="MinTrackSize" value="14"/>
<Property key="VerticalAlignment" value="false"/>
<Property key="MoveToClick" value="true"/>
<Property key="TrackFill" value="1"/>
<Resource type="ResourceLayout" name="MW_HScroll" size="90 14">
<Widget type="Widget" position="0 0 90 14" name="Root">
<Property key="WheelPage" value="36"/>
<Property key="ViewPage" value="36"/>
<Property key="Page" value="36"/>
<Property key="MoveToClick" value="true"/>
<Property key="VerticalAlignment" value="false"/>
<Property key="WheelPage" value="36"/>
<Property key="ViewPage" value="36"/>
<Property key="Page" value="36"/>
<UserString key="TrackFill" value="true"/>
<UserString key="TrackRangeMargins" value="20 19"/>
<UserString key="MinTrackSize" value="14"/>
<!-- Tracker must be last to be on top and receive mouse events -->
<!-- Tracker must be last to be on top and receive mouse events -->
<Child type="Button" skin="MW_Box" offset="18 0 54 14" align="Stretch" name="Background"/>
<Widget type="Button" skin="MW_Box" position="18 0 54 14" align="Stretch" name="Background" />
<!-- These are only provided to get mouse input, they should have no skin and be transparent -->
<!-- These are only provided to get mouse input, they should have no skin and be transparent -->
<Child type="Button" skin="MW_ScrollEmptyPart" offset="14 0 24 14" align="Top HStretch" name="FirstPart"/>
<Child type="Button" skin="MW_ScrollEmptyPart" offset="52 0 24 14" align="Top HStretch" name="SecondPart"/>
<Widget type="Button" skin="MW_ScrollEmptyPart" position="14 0 24 14" align="Top HStretch" name="FirstPart" />
<Widget type="Button" skin="MW_ScrollEmptyPart" position="52 0 24 14" align="Top HStretch" name="SecondPart" />
<!-- Arrows -->
<!-- Arrows -->
<Child type="Widget" skin="MW_Box" offset="0 0 15 14" align="Left VStretch"/>
<Child type="Button" skin="MW_ArrowLeft" offset="2 2 10 10" align="Left VStretch" name="Start"/>
<Widget type="Widget" skin="MW_Box" position="0 0 15 14" align="Left VStretch" />
<Widget type="Button" skin="MW_ArrowLeft" position="2 2 10 10" align="Left VStretch" name="Start" />
<Child type="Widget" skin="MW_Box" offset="75 0 15 14" align="Right VStretch"/>
<Child type="Button" skin="MW_ArrowRight" offset="77 2 10 10" align="Right VStretch" name="End"/>
<Widget type="Widget" skin="MW_Box" position="75 0 15 14" align="Right VStretch" />
<Widget type="Button" skin="MW_ArrowRight" position="77 2 10 10" align="Right VStretch" name="End" />
<Child type="Button" skin="MW_ScrollTrackH" offset="38 2 30 9" align="Left VStretch" name="Track"/>
<Widget type="Button" skin="MW_ScrollTrackH" position="38 2 30 9" align="Left VStretch" name="Track" />
</Widget>
</Resource>
<Resource type="AutoSizedResourceSkin" name="MW_ScrollTrackH" texture="textures\omw_menu_scroll_center_h.dds">
<Property key="MinTrackSize" value="14"/>
<BasisSkin type="TileRect" align="Stretch">
<State name="normal">
<Property key="TileH" value="true"/>
@ -47,41 +48,41 @@
<!-- Vertical Scrollbar -->
<Resource type="ResourceSkin" name="MW_VScroll" size="14 90">
<Property key="TrackRangeMargins" value="20 19"/>
<Property key="MinTrackSize" value="14"/>
<Property key="MoveToClick" value="true"/>
<Property key="TrackFill" value="1"/>
<Resource type="ResourceLayout" name="MW_VScroll" size="14 90">
<Widget type="Widget" position="0 0 14 90" name="Root">
<Property key="WheelPage" value="36"/>
<Property key="ViewPage" value="36"/>
<Property key="Page" value="36"/>
<Property key="MoveToClick" value="true"/>
<Property key="WheelPage" value="36"/>
<Property key="ViewPage" value="36"/>
<Property key="Page" value="36"/>
<UserString key="TrackFill" value="true"/>
<UserString key="TrackRangeMargins" value="20 19"/>
<UserString key="MinTrackSize" value="14"/>
<!-- Background widget trick that must go first to be placed behind Track and FirstPart/SecondPart widgets, provides the bar texture -->
<!-- Background widget trick that must go first to be placed behind Track and FirstPart/SecondPart widgets, provides the bar texture -->
<Child type="Button" skin="MW_Box" offset="0 18 14 55" align="Stretch" name="Background"/>
<Widget type="Button" skin="MW_Box" position="0 18 14 55" align="Stretch" name="Background" />
<!-- These are only provided to get mouse input, they should have no skin and be transparent -->
<!-- These are only provided to get mouse input, they should have no skin and be transparent -->
<Child type="Button" skin="MW_ScrollEmptyPart" offset="0 14 24 14" align="Left VStretch" name="FirstPart"/>
<Child type="Button" skin="MW_ScrollEmptyPart" offset="0 52 24 14" align="Left VStretch" name="SecondPart"/>
<Widget type="Button" skin="MW_ScrollEmptyPart" position="0 14 24 14" align="Left VStretch" name="FirstPart" />
<Widget type="Button" skin="MW_ScrollEmptyPart" position="0 52 24 14" align="Left VStretch" name="SecondPart" />
<!-- Arrows -->
<!-- Arrows -->
<Child type="Widget" skin="MW_Box" offset="0 0 14 15" align="Top HStretch"/>
<Child type="Button" skin="MW_ArrowUp" offset="2 2 10 10" align="Top HStretch" name="Start"/>
<Widget type="Widget" skin="MW_Box" position="0 0 14 15" align="Top HStretch" />
<Widget type="Button" skin="MW_ArrowUp" position="2 2 10 10" align="Top HStretch" name="Start" />
<Child type="Widget" skin="MW_Box" offset="0 76 14 15" align="Bottom HStretch"/>
<Child type="Button" skin="MW_ArrowDown" offset="2 78 10 10" align="Bottom HStretch" name="End"/>
<Widget type="Widget" skin="MW_Box" position="0 76 14 15" align="Bottom HStretch" />
<Widget type="Button" skin="MW_ArrowDown" position="2 78 10 10" align="Bottom HStretch" name="End" />
<!-- Tracker must be last to be on top and receive mouse events -->
<Child type="Button" skin="MW_ScrollTrackV" offset="2 40 9 30" align="Top HStretch" name="Track"/>
<!-- Tracker must be last to be on top and receive mouse events -->
<Widget type="Button" skin="MW_ScrollTrackV" position="2 40 9 30" align="Top HStretch" name="Track" />
</Widget>
</Resource>
<Resource type="AutoSizedResourceSkin" name="MW_ScrollTrackV" texture="textures\omw_menu_scroll_center_v.dds">
<Property key="MinTrackSize" value="14"/>
<BasisSkin type="TileRect" align="Stretch">
<State name="normal">
<Property key="TileH" value="true"/>
@ -123,39 +124,36 @@
</BasisSkin>
</Resource>
<Resource type="ResourceSkin" name="MW_List" size="516 516" align="Left Top">
<Property key="NeedKey" value="true"/>
<Property key="SkinLine" value="MW_ListLine"/>
<Child type="Widget" skin="MW_Box" offset="0 0 516 516" align="Stretch"/>
<Child type="ScrollBar" skin="MW_VScroll" offset="498 4 14 508" align="Right VStretch" name="VScroll"/>
<Child type="Widget" skin="" offset="3 4 493 508" align="Stretch" name="Client"/>
</Resource>
<Resource type="ResourceSkin" name="MW_PopupList" size="516 516" align="Left Top">
<Property key="NeedKey" value="true"/>
<Property key="SkinLine" value="MW_ListLine"/>
<Child type="Widget" skin="BlackBG" offset="0 0 516 516" align="Stretch"/>
<Child type="Widget" skin="MW_Box" offset="0 0 516 516" align="Stretch"/>
<Child type="ScrollBar" skin="MW_VScroll" offset="498 3 14 509" align="Right VStretch" name="VScroll"/>
<Child type="Widget" skin="" offset="3 3 493 509" align="Stretch" name="Client"/>
</Resource>
<Resource type="ResourceSkin" name="MW_PopupListNoTransp" size="516 516" align="Left Top">
<Property key="NeedKey" value="true"/>
<Property key="SkinLine" value="MW_ListLine"/>
<Child type="Widget" skin="FullBlackBG" offset="0 0 516 516" align="Stretch"/>
<Child type="Widget" skin="MW_Box" offset="0 0 516 516" align="Stretch"/>
<Child type="ScrollBar" skin="MW_VScroll" offset="498 3 14 509" align="Right VStretch" name="VScroll"/>
<Child type="Widget" skin="" offset="3 3 493 509" align="Stretch" name="Client"/>
<Resource type="ResourceLayout" name="MW_List" size="516 516" align="Left Top">
<Widget type="Widget" position="0 0 516 516" name="Root">
<Property key="NeedKey" value="true"/>
<UserString key="SkinLine" value="MW_ListLine"/>
<Widget type="Widget" skin="MW_Box" position="0 0 516 516" align="Stretch" />
<Widget type="ScrollBar" skin="MW_VScroll" position="498 4 14 508" align="Right VStretch" name="VScroll" />
<Widget type="Widget" skin="" position="3 4 493 508" align="Stretch" name="Client" />
</Widget>
</Resource>
<Resource type="ResourceLayout" name="MW_PopupList" size="516 516" align="Left Top">
<Widget type="Widget" position="0 0 516 516" name="Root">
<Property key="NeedKey" value="true"/>
<UserString key="SkinLine" value="MW_ListLine"/>
<Widget type="Widget" skin="BlackBG" position="0 0 516 516" align="Stretch" />
<Widget type="Widget" skin="MW_Box" position="0 0 516 516" align="Stretch" />
<Widget type="ScrollBar" skin="MW_VScroll" position="498 3 14 509" align="Right VStretch" name="VScroll" />
<Widget type="Widget" skin="" position="3 3 493 509" align="Stretch" name="Client" />
</Widget>
</Resource>
<Resource type="ResourceLayout" name="MW_PopupListNoTransp" size="516 516" align="Left Top">
<Widget type="Widget" position="0 0 516 516" name="Root">
<Property key="NeedKey" value="true"/>
<UserString key="SkinLine" value="MW_ListLine"/>
<Widget type="Widget" skin="FullBlackBG" position="0 0 516 516" align="Stretch" />
<Widget type="Widget" skin="MW_Box" position="0 0 516 516" align="Stretch" />
<Widget type="ScrollBar" skin="MW_VScroll" position="498 3 14 509" align="Right VStretch" name="VScroll" />
<Widget type="Widget" skin="" position="3 3 493 509" align="Stretch" name="Client" />
</Widget>
</Resource>
<Resource type="ResourceSkin" name="MW_ItemView" size="516 516" align="Left Top">

@ -49,46 +49,48 @@
<!-- Main energy bar widget definitions. There's one for each color.-->
<Resource type="ResourceSkin" name="MW_Progress_Red" size="64 12">
<Property key="TrackSkin" value="MW_Track_Red"/>
<Property key="TrackFill" value="1"/>
<Child type="Widget" skin="MW_Box" offset="0 0 64 12" align="Stretch"/>
<Child type="Widget" skin="TransparentBG" offset="2 2 60 8" align="Stretch" name="Client"/>
<Resource type="ResourceLayout" name="MW_Progress_Red" size="64 12">
<Widget type="Widget" position="0 0 64 12" name="Root">
<UserString key="TrackSkin" value="MW_Track_Red"/>
<UserString key="TrackFill" value="true"/>
<Widget type="Widget" skin="TransparentBG" position="2 2 60 8" align="Stretch" name="Client" />
<Widget type="Widget" skin="MW_Box" position="0 0 64 12" align="Stretch" />
</Widget>
</Resource>
<Resource type="ResourceSkin" name="MW_Progress_Green" size="64 12">
<Property key="TrackSkin" value="MW_Track_Green"/>
<Property key="TrackFill" value="1"/>
<Child type="Widget" skin="MW_Box" offset="0 0 64 12" align="Stretch"/>
<Child type="Widget" skin="TransparentBG" offset="2 2 60 8" align="Stretch" name="Client"/>
<Resource type="ResourceLayout" name="MW_Progress_Green" size="64 12">
<Widget type="Widget" position="0 0 64 12" name="Root">
<UserString key="TrackSkin" value="MW_Track_Green"/>
<UserString key="TrackFill" value="true"/>
<Widget type="Widget" skin="TransparentBG" position="2 2 60 8" align="Stretch" name="Client" />
<Widget type="Widget" skin="MW_Box" position="0 0 64 12" align="Stretch" />
</Widget>
</Resource>
<Resource type="ResourceSkin" name="MW_Progress_Blue" size="64 12">
<Property key="TrackSkin" value="MW_Track_Blue"/>
<Property key="TrackFill" value="1"/>
<Child type="Widget" skin="MW_Box" offset="0 0 64 12" align="Stretch"/>
<Child type="Widget" skin="TransparentBG" offset="2 2 60 8" align="Stretch" name="Client"/>
<Resource type="ResourceLayout" name="MW_Progress_Blue" size="64 12">
<Widget type="Widget" position="0 0 64 12" name="Root">
<UserString key="TrackSkin" value="MW_Track_Blue"/>
<UserString key="TrackFill" value="true"/>
<Widget type="Widget" skin="TransparentBG" position="2 2 60 8" align="Stretch" name="Client" />
<Widget type="Widget" skin="MW_Box" position="0 0 64 12" align="Stretch" />
</Widget>
</Resource>
<Resource type="ResourceSkin" name="MW_Progress_Drowning_Full" size="64 6">
<Property key="TrackSkin" value="MW_Progress_Drowning_Full_Small"/>
<Property key="TrackFill" value="1"/>
<Child type="Widget" skin="TransparentBG" offset="2 2 60 2" align="Stretch" name="Client"/>
<Resource type="ResourceLayout" name="MW_Progress_Drowning_Full" size="64 6">
<Widget type="Widget" position="0 0 64 6" name="Root">
<UserString key="TrackSkin" value="MW_Progress_Drowning_Full_Small"/>
<UserString key="TrackFill" value="true"/>
<Widget type="Widget" skin="TransparentBG" position="2 2 60 2" align="Stretch" name="Client" />
</Widget>
</Resource>
<Resource type="ResourceSkin" name="MW_ProgressScroll_Loading" size="64 6">
<Property key="TrackFill" value="1"/>
<Property key="TrackRangeMargins" value="0 0"/>
<Property key="MinTrackSize" value="1"/>
<Property key="VerticalAlignment" value="false"/>
<Property key="MoveToClick" value="false"/>
<Child type="Widget" skin="TransparentBG" offset="2 2 60 2" align="Stretch" name="Client"/>
<Child type="Button" skin="MW_Progress_Loading_Small" offset="0 0 1 6" align="Left VStretch" name="Track"/>
<Child type="Widget" skin="MW_Box" offset="0 0 64 6" align="Stretch"/>
<Resource type="ResourceLayout" name="MW_ProgressScroll_Loading" size="64 6">
<Widget type="Widget" position="0 0 64 6" name="Root">
<UserString key="TrackFill" value="true"/>
<Property key="VerticalAlignment" value="false"/>
<Widget type="Widget" skin="TransparentBG" position="2 2 60 2" align="Stretch" />
<Widget type="Button" skin="MW_Progress_Loading_Small" position="0 0 1 6" align="Left VStretch" name="Track" />
<Widget type="Widget" skin="MW_Box" position="0 0 64 6" align="Stretch" />
</Widget>
</Resource>
</MyGUI>

Loading…
Cancel
Save