mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-28 21:07:59 +03:00
Apply clang-format to code base
This commit is contained in:
parent
f37d0be806
commit
ddb0522bbf
2199 changed files with 118692 additions and 114392 deletions
|
@ -1,7 +1,7 @@
|
|||
#include "list.hpp"
|
||||
|
||||
#include <MyGUI_Gui.h>
|
||||
#include <MyGUI_Button.h>
|
||||
#include <MyGUI_Gui.h>
|
||||
#include <MyGUI_ImageBox.h>
|
||||
|
||||
namespace Gui
|
||||
|
@ -22,9 +22,9 @@ namespace Gui
|
|||
if (mClient == nullptr)
|
||||
mClient = this;
|
||||
|
||||
mScrollView = mClient->createWidgetReal<MyGUI::ScrollView>(
|
||||
"MW_ScrollView", MyGUI::FloatCoord(0.0, 0.0, 1.0, 1.0),
|
||||
MyGUI::Align::Top | MyGUI::Align::Left | MyGUI::Align::Stretch, getName() + "_ScrollView");
|
||||
mScrollView
|
||||
= mClient->createWidgetReal<MyGUI::ScrollView>("MW_ScrollView", MyGUI::FloatCoord(0.0, 0.0, 1.0, 1.0),
|
||||
MyGUI::Align::Top | MyGUI::Align::Left | MyGUI::Align::Stretch, getName() + "_ScrollView");
|
||||
}
|
||||
|
||||
void MWList::addItem(std::string_view name)
|
||||
|
@ -55,16 +55,15 @@ namespace Gui
|
|||
}
|
||||
|
||||
mItemHeight = 0;
|
||||
int i=0;
|
||||
for (std::vector<std::string>::const_iterator it=mItems.begin();
|
||||
it!=mItems.end(); ++it)
|
||||
int i = 0;
|
||||
for (std::vector<std::string>::const_iterator it = mItems.begin(); it != mItems.end(); ++it)
|
||||
{
|
||||
if (*it != "")
|
||||
{
|
||||
if (mListItemSkin.empty())
|
||||
return;
|
||||
MyGUI::Button* button = mScrollView->createWidget<MyGUI::Button>(
|
||||
mListItemSkin, MyGUI::IntCoord(0, mItemHeight, mScrollView->getSize().width - scrollBarWidth - 2, 24),
|
||||
MyGUI::Button* button = mScrollView->createWidget<MyGUI::Button>(mListItemSkin,
|
||||
MyGUI::IntCoord(0, mItemHeight, mScrollView->getSize().width - scrollBarWidth - 2, 24),
|
||||
MyGUI::Align::Left | MyGUI::Align::Top, getName() + "_item_" + (*it));
|
||||
button->setCaption((*it));
|
||||
button->getSubWidgetText()->setWordWrap(true);
|
||||
|
@ -91,7 +90,8 @@ namespace Gui
|
|||
++i;
|
||||
}
|
||||
|
||||
// Canvas size must be expressed with VScroll disabled, otherwise MyGUI would expand the scroll area when the scrollbar is hidden
|
||||
// Canvas size must be expressed with VScroll disabled, otherwise MyGUI would expand the scroll area when the
|
||||
// scrollbar is hidden
|
||||
mScrollView->setVisibleVScroll(false);
|
||||
mScrollView->setCanvasSize(mClient->getSize().width, std::max(mItemHeight, mClient->getSize().height));
|
||||
mScrollView->setVisibleVScroll(true);
|
||||
|
@ -100,12 +100,12 @@ namespace Gui
|
|||
redraw(true);
|
||||
|
||||
int viewRange = mScrollView->getCanvasSize().height;
|
||||
if(viewPosition > viewRange)
|
||||
if (viewPosition > viewRange)
|
||||
viewPosition = viewRange;
|
||||
mScrollView->setViewOffset(MyGUI::IntPoint(0, -viewPosition));
|
||||
}
|
||||
|
||||
void MWList::setPropertyOverride(const std::string &_key, const std::string &_value)
|
||||
void MWList::setPropertyOverride(const std::string& _key, const std::string& _value)
|
||||
{
|
||||
if (_key == "ListItemSkin")
|
||||
mListItemSkin = _value;
|
||||
|
@ -126,8 +126,8 @@ namespace Gui
|
|||
|
||||
void MWList::removeItem(const std::string& name)
|
||||
{
|
||||
assert( std::find(mItems.begin(), mItems.end(), name) != mItems.end() );
|
||||
mItems.erase( std::find(mItems.begin(), mItems.end(), name) );
|
||||
assert(std::find(mItems.begin(), mItems.end(), name) != mItems.end());
|
||||
mItems.erase(std::find(mItems.begin(), mItems.end(), name));
|
||||
}
|
||||
|
||||
void MWList::clear()
|
||||
|
@ -137,11 +137,12 @@ namespace Gui
|
|||
|
||||
void MWList::onMouseWheelMoved(MyGUI::Widget* _sender, int _rel)
|
||||
{
|
||||
//NB view offset is negative
|
||||
if (mScrollView->getViewOffset().top + _rel*0.3f > 0)
|
||||
// NB view offset is negative
|
||||
if (mScrollView->getViewOffset().top + _rel * 0.3f > 0)
|
||||
mScrollView->setViewOffset(MyGUI::IntPoint(0, 0));
|
||||
else
|
||||
mScrollView->setViewOffset(MyGUI::IntPoint(0, static_cast<int>(mScrollView->getViewOffset().top + _rel*0.3)));
|
||||
mScrollView->setViewOffset(
|
||||
MyGUI::IntPoint(0, static_cast<int>(mScrollView->getViewOffset().top + _rel * 0.3)));
|
||||
}
|
||||
|
||||
void MWList::onItemSelected(MyGUI::Widget* _sender)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue