Skip to content

Commit

Permalink
Replace any uses of CGUIScrollBar and IGUIScrollBar with GUIScrollBar
Browse files Browse the repository at this point in the history
  • Loading branch information
Desour authored and sfan5 committed Aug 14, 2023
1 parent 124d064 commit 9d62abb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/gui/guiTable.cpp
Expand Up @@ -901,7 +901,7 @@ bool GUITable::OnEvent(const SEvent &event)
setToolTipText(cell ? m_strings[cell->tooltip_index].c_str() : L"");

// Fix for #1567/#1806:
// IGUIScrollBar passes double click events to its parent,
// GUIScrollBar passes double click events to its parent,
// which we don't want. Detect this case and discard the event
if (event.MouseInput.Event != EMIE_MOUSE_MOVED &&
m_scrollbar->isVisible() &&
Expand Down
8 changes: 4 additions & 4 deletions src/gui/guiVolumeChange.cpp
Expand Up @@ -20,11 +20,11 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "guiVolumeChange.h"
#include "debug.h"
#include "guiButton.h"
#include "guiScrollBar.h"
#include "serialization.h"
#include <string>
#include <IGUICheckBox.h>
#include <IGUIButton.h>
#include <IGUIScrollBar.h>
#include <IGUIStaticText.h>
#include <IGUIFont.h>
#include "settings.h"
Expand Down Expand Up @@ -85,8 +85,8 @@ void GUIVolumeChange::regenerateGui(v2u32 screensize)
{
core::rect<s32> rect(0, 0, 300 * s, 20 * s);
rect = rect + v2s32(size.X / 2 - 150 * s, size.Y / 2);
gui::IGUIScrollBar *e = Environment->addScrollBar(true,
rect, this, ID_soundSlider);
auto e = make_irr<GUIScrollBar>(Environment, this,
ID_soundSlider, rect, true, false);
e->setMax(100);
e->setPos(volume);
}
Expand Down Expand Up @@ -151,7 +151,7 @@ bool GUIVolumeChange::OnEvent(const SEvent& event)
}
if (event.GUIEvent.EventType == gui::EGET_SCROLL_BAR_CHANGED) {
if (event.GUIEvent.Caller->getID() == ID_soundSlider) {
s32 pos = ((gui::IGUIScrollBar*)event.GUIEvent.Caller)->getPos();
s32 pos = static_cast<GUIScrollBar *>(event.GUIEvent.Caller)->getPos();
g_settings->setFloat("sound_volume", (float) pos / 100);

gui::IGUIElement *e = getElementFromId(ID_soundText);
Expand Down

0 comments on commit 9d62abb

Please sign in to comment.