mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-21 11:23:51 +00:00
adjust topic list on window resize
This commit is contained in:
parent
8a9e05a96b
commit
de995e3a69
4 changed files with 19 additions and 1 deletions
|
@ -67,6 +67,8 @@ DialogueWindow::DialogueWindow(WindowManager& parWindowManager)
|
||||||
|
|
||||||
getWidget(pDispositionBar, "Disposition");
|
getWidget(pDispositionBar, "Disposition");
|
||||||
getWidget(pDispositionText,"DispositionText");
|
getWidget(pDispositionText,"DispositionText");
|
||||||
|
|
||||||
|
static_cast<MyGUI::Window*>(mMainWidget)->eventWindowChangeCoord += MyGUI::newDelegate(this, &DialogueWindow::onWindowResize);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogueWindow::onHistoryClicked(MyGUI::Widget* _sender)
|
void DialogueWindow::onHistoryClicked(MyGUI::Widget* _sender)
|
||||||
|
@ -88,6 +90,11 @@ void DialogueWindow::onHistoryClicked(MyGUI::Widget* _sender)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DialogueWindow::onWindowResize(MyGUI::Window* _sender)
|
||||||
|
{
|
||||||
|
topicsList->adjustSize();
|
||||||
|
}
|
||||||
|
|
||||||
void DialogueWindow::onMouseWheel(MyGUI::Widget* _sender, int _rel)
|
void DialogueWindow::onMouseWheel(MyGUI::Widget* _sender, int _rel)
|
||||||
{
|
{
|
||||||
if (history->getVScrollPosition() - _rel*0.3 < 0)
|
if (history->getVScrollPosition() - _rel*0.3 < 0)
|
||||||
|
|
|
@ -51,6 +51,7 @@ namespace MWGui
|
||||||
void onByeClicked(MyGUI::Widget* _sender);
|
void onByeClicked(MyGUI::Widget* _sender);
|
||||||
void onHistoryClicked(MyGUI::Widget* _sender);
|
void onHistoryClicked(MyGUI::Widget* _sender);
|
||||||
void onMouseWheel(MyGUI::Widget* _sender, int _rel);
|
void onMouseWheel(MyGUI::Widget* _sender, int _rel);
|
||||||
|
void onWindowResize(MyGUI::Window* _sender);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void updateOptions();
|
void updateOptions();
|
||||||
|
|
|
@ -32,6 +32,11 @@ void MWList::addItem(const std::string& name)
|
||||||
redraw();
|
redraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MWList::adjustSize()
|
||||||
|
{
|
||||||
|
redraw();
|
||||||
|
}
|
||||||
|
|
||||||
void MWList::redraw(bool scrollbarShown)
|
void MWList::redraw(bool scrollbarShown)
|
||||||
{
|
{
|
||||||
const int _scrollBarWidth = 24; // fetch this from skin?
|
const int _scrollBarWidth = 24; // fetch this from skin?
|
||||||
|
|
|
@ -9,7 +9,7 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* \brief a very simple list widget that supports word-wrapping entries
|
* \brief a very simple list widget that supports word-wrapping entries
|
||||||
* \note does not handle changing the width of the list at runtime
|
* \note if the width or height of the list changes, you must call adjustSize() method
|
||||||
*/
|
*/
|
||||||
class MWList : public MyGUI::Widget
|
class MWList : public MyGUI::Widget
|
||||||
{
|
{
|
||||||
|
@ -25,6 +25,11 @@ namespace MWGui
|
||||||
*/
|
*/
|
||||||
EventHandle_String eventItemSelected;
|
EventHandle_String eventItemSelected;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Call after the size of the list changed
|
||||||
|
*/
|
||||||
|
void adjustSize();
|
||||||
|
|
||||||
void addItem(const std::string& name);
|
void addItem(const std::string& name);
|
||||||
void removeItem(const std::string& name);
|
void removeItem(const std::string& name);
|
||||||
bool hasItem(const std::string& name);
|
bool hasItem(const std::string& name);
|
||||||
|
|
Loading…
Reference in a new issue