summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2025-04-02 11:35:58 +0200
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2025-04-02 11:36:04 +0200
commitba8317a8172754fb422e559aadfddc3dd8b1ec5e (patch)
tree814935756526770cde8640398386de835933720b /src/gui
parent0f8e03229b5aaa1727c612a55180945c7608ad2d (diff)
downloadmana-ba8317a8172754fb422e559aadfddc3dd8b1ec5e.tar.gz
mana-ba8317a8172754fb422e559aadfddc3dd8b1ec5e.tar.bz2
mana-ba8317a8172754fb422e559aadfddc3dd8b1ec5e.tar.xz
mana-ba8317a8172754fb422e559aadfddc3dd8b1ec5e.zip
Use a consistent naming style for enum class values
Sometimes I've used CamelCase and sometimes SNAKE_CASE for these values. Since "enum class" values are always prefixed with the enum name, which uses CamelCase, I find it more fitting to use it for the values as well. Also fixes compilation on Windows where 'ERROR' was conflicting with a define.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/charcreatedialog.cpp12
-rw-r--r--src/gui/charselectdialog.cpp2
-rw-r--r--src/gui/customserverdialog.cpp8
-rw-r--r--src/gui/gui.cpp34
-rw-r--r--src/gui/gui.h37
-rw-r--r--src/gui/ministatuswindow.cpp2
-rw-r--r--src/gui/popupmenu.cpp18
-rw-r--r--src/gui/register.cpp2
-rw-r--r--src/gui/selldialog.cpp2
-rw-r--r--src/gui/serverdialog.cpp10
-rw-r--r--src/gui/skilldialog.cpp2
-rw-r--r--src/gui/statuswindow.cpp2
-rw-r--r--src/gui/updaterwindow.cpp34
-rw-r--r--src/gui/updaterwindow.h10
-rw-r--r--src/gui/viewport.cpp10
-rw-r--r--src/gui/widgets/browserbox.cpp4
-rw-r--r--src/gui/widgets/window.cpp16
17 files changed, 103 insertions, 102 deletions
diff --git a/src/gui/charcreatedialog.cpp b/src/gui/charcreatedialog.cpp
index d5bdf3ca..cff7d822 100644
--- a/src/gui/charcreatedialog.cpp
+++ b/src/gui/charcreatedialog.cpp
@@ -50,7 +50,7 @@ CharCreateDialog::CharCreateDialog(CharSelectDialog *parent, int slot):
mSlot(slot)
{
mPlayer = new Being(0, ActorSprite::PLAYER, 0, nullptr);
- mPlayer->setGender(Gender::MALE);
+ mPlayer->setGender(Gender::Male);
const std::vector<int> &items = CharDB::getDefaultItems();
for (size_t i = 0; i < items.size(); ++i)
@@ -175,7 +175,7 @@ void CharCreateDialog::action(const gcn::ActionEvent &event)
{
if (event.getId() == "create")
{
- if (Net::getNetworkType() == ServerType::MANASERV
+ if (Net::getNetworkType() == ServerType::ManaServ
|| getName().length() >= 4)
{
// Attempt to create the character
@@ -183,7 +183,7 @@ void CharCreateDialog::action(const gcn::ActionEvent &event)
int characterSlot = mSlot;
// On Manaserv, the slots start at 1, so we offset them.
- if (Net::getNetworkType() == ServerType::MANASERV)
+ if (Net::getNetworkType() == ServerType::ManaServ)
++characterSlot;
// Should avoid the most common crash case
@@ -234,9 +234,9 @@ void CharCreateDialog::action(const gcn::ActionEvent &event)
else if (event.getId() == "gender")
{
if (mMale->isSelected())
- mPlayer->setGender(Gender::MALE);
+ mPlayer->setGender(Gender::Male);
else
- mPlayer->setGender(Gender::FEMALE);
+ mPlayer->setGender(Gender::Female);
}
}
@@ -376,7 +376,7 @@ void CharCreateDialog::setAttributes(const std::vector<std::string> &labels,
void CharCreateDialog::setDefaultGender(Gender gender)
{
- if (gender == Gender::FEMALE)
+ if (gender == Gender::Female)
{
mFemale->setSelected(true);
mMale->setSelected(false);
diff --git a/src/gui/charselectdialog.cpp b/src/gui/charselectdialog.cpp
index eb649c58..2485be69 100644
--- a/src/gui/charselectdialog.cpp
+++ b/src/gui/charselectdialog.cpp
@@ -266,7 +266,7 @@ void CharSelectDialog::setCharacters(const Net::Characters &characters)
{
// Slots Number start at 1 for Manaserv, so we offset them by one.
int characterSlot = character->slot;
- if (Net::getNetworkType() == ServerType::MANASERV && characterSlot > 0)
+ if (Net::getNetworkType() == ServerType::ManaServ && characterSlot > 0)
--characterSlot;
if (characterSlot >= (int)mCharacterEntries.size())
diff --git a/src/gui/customserverdialog.cpp b/src/gui/customserverdialog.cpp
index 5ed3a445..5524e459 100644
--- a/src/gui/customserverdialog.cpp
+++ b/src/gui/customserverdialog.cpp
@@ -104,7 +104,7 @@ CustomServerDialog::CustomServerDialog(ServerDialog *parent, int index):
mServerAddressField->setText(serverInfo.hostname);
mPortField->setText(toString(serverInfo.port));
#ifdef MANASERV_SUPPORT
- mTypeField->setSelected(serverInfo.type == ServerType::TMWATHENA ?
+ mTypeField->setSelected(serverInfo.type == ServerType::TmwAthena ?
0 : 1);
#endif
}
@@ -145,13 +145,13 @@ void CustomServerDialog::action(const gcn::ActionEvent &event)
switch (mTypeField->getSelected())
{
case 0:
- serverInfo.type = ServerType::TMWATHENA;
+ serverInfo.type = ServerType::TmwAthena;
break;
case 1:
- serverInfo.type = ServerType::MANASERV;
+ serverInfo.type = ServerType::ManaServ;
break;
default:
- serverInfo.type = ServerType::UNKNOWN;
+ serverInfo.type = ServerType::Unknown;
}
#else
serverInfo.type = ServerType::TMWATHENA;
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp
index f9a36472..d72bd56d 100644
--- a/src/gui/gui.cpp
+++ b/src/gui/gui.cpp
@@ -299,7 +299,7 @@ void Gui::loadCustomCursors()
0, targetCursorSize, targetCursorSize, 32,
rmask, gmask, bmask, amask);
- for (int i = 0; i <= static_cast<int>(Cursor::LAST); ++i)
+ for (int i = 0; i < static_cast<int>(Cursor::Count); ++i)
{
int x = i % columns * cursorSize;
int y = i / columns * cursorSize;
@@ -328,22 +328,22 @@ void Gui::loadSystemCursors()
constexpr struct {
Cursor cursor;
SDL_SystemCursor systemCursor;
- } cursors[static_cast<int>(Cursor::LAST) + 1] = {
- { Cursor::POINTER, SDL_SYSTEM_CURSOR_ARROW },
- { Cursor::RESIZE_ACROSS, SDL_SYSTEM_CURSOR_SIZEWE },
- { Cursor::RESIZE_DOWN, SDL_SYSTEM_CURSOR_SIZENS },
- { Cursor::RESIZE_DOWN_LEFT, SDL_SYSTEM_CURSOR_SIZENESW },
- { Cursor::RESIZE_DOWN_RIGHT, SDL_SYSTEM_CURSOR_SIZENWSE },
- { Cursor::FIGHT, SDL_SYSTEM_CURSOR_HAND },
- { Cursor::PICKUP, SDL_SYSTEM_CURSOR_HAND },
- { Cursor::TALK, SDL_SYSTEM_CURSOR_HAND },
- { Cursor::ACTION, SDL_SYSTEM_CURSOR_HAND },
- { Cursor::LEFT, SDL_SYSTEM_CURSOR_ARROW },
- { Cursor::UP, SDL_SYSTEM_CURSOR_ARROW },
- { Cursor::RIGHT, SDL_SYSTEM_CURSOR_ARROW },
- { Cursor::DOWN, SDL_SYSTEM_CURSOR_ARROW },
- { Cursor::DRAG, SDL_SYSTEM_CURSOR_SIZEALL },
- { Cursor::HAND, SDL_SYSTEM_CURSOR_HAND },
+ } cursors[static_cast<int>(Cursor::Count)] = {
+ { Cursor::Pointer, SDL_SYSTEM_CURSOR_ARROW },
+ { Cursor::ResizeAcross, SDL_SYSTEM_CURSOR_SIZEWE },
+ { Cursor::ResizeDown, SDL_SYSTEM_CURSOR_SIZENS },
+ { Cursor::ResizeDownLeft, SDL_SYSTEM_CURSOR_SIZENESW },
+ { Cursor::ResizeDownRight, SDL_SYSTEM_CURSOR_SIZENWSE },
+ { Cursor::Fight, SDL_SYSTEM_CURSOR_HAND },
+ { Cursor::PickUp, SDL_SYSTEM_CURSOR_HAND },
+ { Cursor::Talk, SDL_SYSTEM_CURSOR_HAND },
+ { Cursor::Action, SDL_SYSTEM_CURSOR_HAND },
+ { Cursor::Left, SDL_SYSTEM_CURSOR_ARROW },
+ { Cursor::Up, SDL_SYSTEM_CURSOR_ARROW },
+ { Cursor::Right, SDL_SYSTEM_CURSOR_ARROW },
+ { Cursor::Down, SDL_SYSTEM_CURSOR_ARROW },
+ { Cursor::Drag, SDL_SYSTEM_CURSOR_SIZEALL },
+ { Cursor::Hand, SDL_SYSTEM_CURSOR_HAND },
};
for (auto cursor : cursors)
diff --git a/src/gui/gui.h b/src/gui/gui.h
index 0441d18e..450514f5 100644
--- a/src/gui/gui.h
+++ b/src/gui/gui.h
@@ -50,23 +50,24 @@ class SDLInput;
* Cursors are in graphic order from left to right.
* CURSOR_POINTER should be left untouched.
*/
-enum class Cursor {
- POINTER = 0,
- RESIZE_ACROSS,
- RESIZE_DOWN,
- RESIZE_DOWN_LEFT,
- RESIZE_DOWN_RIGHT,
- FIGHT,
- PICKUP,
- TALK,
- ACTION,
- LEFT,
- UP,
- RIGHT,
- DOWN,
- DRAG,
- HAND,
- LAST = HAND,
+enum class Cursor
+{
+ Pointer = 0,
+ ResizeAcross,
+ ResizeDown,
+ ResizeDownLeft,
+ ResizeDownRight,
+ Fight,
+ PickUp,
+ Talk,
+ Action,
+ Left,
+ Up,
+ Right,
+ Down,
+ Drag,
+ Hand,
+ Count,
};
/**
@@ -148,7 +149,7 @@ class Gui final : public gcn::Gui, public EventListener
std::vector<SDL_Cursor *> mSystemMouseCursors;
std::vector<SDL_Cursor *> mCustomMouseCursors;
Timer mMouseActivityTimer;
- Cursor mCursorType = Cursor::POINTER;
+ Cursor mCursorType = Cursor::Pointer;
};
extern Gui *gui; /**< The GUI system */
diff --git a/src/gui/ministatuswindow.cpp b/src/gui/ministatuswindow.cpp
index 4e32848c..9d695954 100644
--- a/src/gui/ministatuswindow.cpp
+++ b/src/gui/ministatuswindow.cpp
@@ -143,7 +143,7 @@ void MiniStatusWindow::event(Event::Channel channel, const Event &event)
}
if (event.getType() == Event::UpdateStat)
{
- if (Net::getNetworkType() == ServerType::TMWATHENA &&
+ if (Net::getNetworkType() == ServerType::TmwAthena &&
event.getInt("id") == TmwAthena::MATK)
{
StatusWindow::updateMPBar(mMpBar);
diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp
index 64f4d753..4bafc074 100644
--- a/src/gui/popupmenu.cpp
+++ b/src/gui/popupmenu.cpp
@@ -91,12 +91,12 @@ void PopupMenu::showPopup(int x, int y, Being *being)
switch (player_relations.getRelation(name))
{
- case PlayerRelation::NEUTRAL:
+ case PlayerRelation::Neutral:
mBrowserBox->addRow(strprintf("@@friend|%s@@",
strprintf(_("Befriend %s"),
name.c_str()).c_str()));
- case PlayerRelation::FRIEND:
+ case PlayerRelation::Friend:
mBrowserBox->addRow(strprintf("@@disregard|%s@@",
strprintf(_("Disregard %s"),
name.c_str()).c_str()));
@@ -105,7 +105,7 @@ void PopupMenu::showPopup(int x, int y, Being *being)
name.c_str()).c_str()));
break;
- case PlayerRelation::DISREGARDED:
+ case PlayerRelation::Disregarded:
mBrowserBox->addRow(strprintf("@@unignore|%s@@",
strprintf(_("Unignore %s"),
name.c_str()).c_str()));
@@ -114,7 +114,7 @@ void PopupMenu::showPopup(int x, int y, Being *being)
name.c_str()).c_str()));
break;
- case PlayerRelation::IGNORED:
+ case PlayerRelation::Ignored:
mBrowserBox->addRow(strprintf("@@unignore|%s@@",
strprintf(_("Unignore %s"),
name.c_str()).c_str()));
@@ -126,7 +126,7 @@ void PopupMenu::showPopup(int x, int y, Being *being)
strprintf(_("Invite %s to join your guild"),
name.c_str()).c_str()));
if (local_player->isInParty() ||
- Net::getNetworkType() == ServerType::MANASERV)
+ Net::getNetworkType() == ServerType::ManaServ)
{
mBrowserBox->addRow(strprintf("@@party|%s@@",
strprintf(_("Invite %s to join your party"),
@@ -223,25 +223,25 @@ void PopupMenu::handleLink(const std::string &link)
else if (link == "unignore" && being &&
being->getType() == ActorSprite::PLAYER)
{
- player_relations.setRelation(being->getName(), PlayerRelation::NEUTRAL);
+ player_relations.setRelation(being->getName(), PlayerRelation::Neutral);
}
else if (link == "ignore" && being &&
being->getType() == ActorSprite::PLAYER)
{
- player_relations.setRelation(being->getName(), PlayerRelation::IGNORED);
+ player_relations.setRelation(being->getName(), PlayerRelation::Ignored);
}
else if (link == "disregard" && being &&
being->getType() == ActorSprite::PLAYER)
{
- player_relations.setRelation(being->getName(), PlayerRelation::DISREGARDED);
+ player_relations.setRelation(being->getName(), PlayerRelation::Disregarded);
}
else if (link == "friend" && being &&
being->getType() == ActorSprite::PLAYER)
{
- player_relations.setRelation(being->getName(), PlayerRelation::FRIEND);
+ player_relations.setRelation(being->getName(), PlayerRelation::Friend);
}
// Guild action
else if (link == "guild" && being &&
diff --git a/src/gui/register.cpp b/src/gui/register.cpp
index 685e4898..62114c10 100644
--- a/src/gui/register.cpp
+++ b/src/gui/register.cpp
@@ -225,7 +225,7 @@ void RegisterDialog::action(const gcn::ActionEvent &event)
mLoginData->password = mPasswordField->getText();
if (mFemaleButton)
mLoginData->gender = mFemaleButton->isSelected() ?
- Gender::FEMALE : Gender::MALE;
+ Gender::Female : Gender::Male;
if (mEmailField)
mLoginData->email = mEmailField->getText();
mLoginData->registerLogin = true;
diff --git a/src/gui/selldialog.cpp b/src/gui/selldialog.cpp
index 5f499982..4aeacd6f 100644
--- a/src/gui/selldialog.cpp
+++ b/src/gui/selldialog.cpp
@@ -205,7 +205,7 @@ void SellDialog::action(const gcn::ActionEvent &event)
sellCount = item->sellCurrentDuplicate(mAmountItems);
// For Manaserv, the Item id is to be given as index.
- if ((Net::getNetworkType() == ServerType::MANASERV))
+ if ((Net::getNetworkType() == ServerType::ManaServ))
itemIndex = item->getId();
Net::getNpcHandler()->sellItem(mNpcId, itemIndex, sellCount);
diff --git a/src/gui/serverdialog.cpp b/src/gui/serverdialog.cpp
index fa4087ce..d86d751a 100644
--- a/src/gui/serverdialog.cpp
+++ b/src/gui/serverdialog.cpp
@@ -351,20 +351,20 @@ void ServerDialog::logic()
auto state = mDownload->getState();
switch (state.status) {
- case DownloadStatus::IN_PROGRESS:
+ case DownloadStatus::InProgress:
mDownloadText->setCaption(strprintf(_("Downloading server list..."
"%2.0f%%"),
state.progress * 100));
break;
- case DownloadStatus::CANCELED:
- case DownloadStatus::ERROR:
+ case DownloadStatus::Canceled:
+ case DownloadStatus::Error:
mDownloadDone = true;
logger->log("Error retrieving server list: %s", mDownload->getError());
mDownloadText->setCaption(_("Error retrieving server list!"));
break;
- case DownloadStatus::COMPLETE:
+ case DownloadStatus::Complete:
mDownloadDone = true;
loadServers();
@@ -433,7 +433,7 @@ void ServerDialog::loadServer(XML::Node serverNode)
server.type = ServerInfo::parseType(type);
// Ignore unknown server types
- if (server.type == ServerType::UNKNOWN
+ if (server.type == ServerType::Unknown
#ifndef MANASERV_SUPPORT
|| server.type == ServerType::MANASERV
#endif
diff --git a/src/gui/skilldialog.cpp b/src/gui/skilldialog.cpp
index 7f45ae9d..c1911ac5 100644
--- a/src/gui/skilldialog.cpp
+++ b/src/gui/skilldialog.cpp
@@ -292,7 +292,7 @@ void SkillDialog::loadSkills()
{
logger->log("Error loading skills file: %s", SKILLS_FILE);
- if (Net::getNetworkType() == ServerType::TMWATHENA)
+ if (Net::getNetworkType() == ServerType::TmwAthena)
{
auto model = std::make_unique<SkillModel>();
auto skill = std::make_unique<SkillInfo>();
diff --git a/src/gui/statuswindow.cpp b/src/gui/statuswindow.cpp
index ffcfa350..108d68cc 100644
--- a/src/gui/statuswindow.cpp
+++ b/src/gui/statuswindow.cpp
@@ -290,7 +290,7 @@ void StatusWindow::event(Event::Channel channel,
it->second->update();
}
- if (Net::getNetworkType() == ServerType::TMWATHENA &&
+ if (Net::getNetworkType() == ServerType::TmwAthena &&
id == TmwAthena::MATK)
{
updateMPBar(mMpBar, true);
diff --git a/src/gui/updaterwindow.cpp b/src/gui/updaterwindow.cpp
index d05a9299..5cfb45cd 100644
--- a/src/gui/updaterwindow.cpp
+++ b/src/gui/updaterwindow.cpp
@@ -210,7 +210,7 @@ void UpdaterWindow::keyPressed(gcn::KeyEvent &keyEvent)
bool UpdaterWindow::cancel()
{
// Skip the updating process
- if (mDialogState != DialogState::DONE)
+ if (mDialogState != DialogState::Done)
{
mDownload->cancel();
return true;
@@ -244,7 +244,7 @@ void UpdaterWindow::startDownload(const std::string &fileName,
else
mDownload->setFile(mUpdatesDir + "/" + fileName, adler32);
- if (mDialogState != DialogState::DOWNLOAD_RESOURCES)
+ if (mDialogState != DialogState::DownloadResources)
mDownload->noCache();
mDownload->start();
@@ -273,28 +273,28 @@ void UpdaterWindow::logic()
{
Window::logic();
- if (mDialogState == DialogState::DONE)
+ if (mDialogState == DialogState::Done)
return;
const auto state = mDownload->getState();
float progress = 0.0f;
switch (state.status) {
- case DownloadStatus::IN_PROGRESS: {
+ case DownloadStatus::InProgress: {
setLabel(mCurrentFile + " (" + toString((int) (state.progress * 100)) + "%)");
progress = state.progress;
break;
}
- case DownloadStatus::CANCELED:
- mDialogState = DialogState::DONE;
+ case DownloadStatus::Canceled:
+ mDialogState = DialogState::Done;
enablePlay();
setLabel(_("Download canceled"));
break;
- case DownloadStatus::ERROR: {
- mDialogState = DialogState::DONE;
+ case DownloadStatus::Error: {
+ mDialogState = DialogState::Done;
std::string error = "##1";
error += mDownload->getError();
@@ -311,7 +311,7 @@ void UpdaterWindow::logic()
break;
}
- case DownloadStatus::COMPLETE:
+ case DownloadStatus::Complete:
downloadCompleted();
break;
}
@@ -323,14 +323,14 @@ void UpdaterWindow::downloadCompleted()
{
switch (mDialogState)
{
- case DialogState::DOWNLOAD_NEWS:
+ case DialogState::DownloadNews:
loadNews();
- mDialogState = DialogState::DOWNLOAD_LIST;
+ mDialogState = DialogState::DownloadList;
startDownload(xmlUpdateFile, false);
break;
- case DialogState::DOWNLOAD_LIST:
+ case DialogState::DownloadList:
if (mCurrentFile == xmlUpdateFile)
{
mUpdateFiles = loadXMLFile(mUpdatesDir + "/" + xmlUpdateFile);
@@ -341,7 +341,7 @@ void UpdaterWindow::downloadCompleted()
xmlUpdateFile, txtUpdateFile);
// If the resources.xml file fails, fall back onto a older version
- mDialogState = DialogState::DOWNLOAD_LIST;
+ mDialogState = DialogState::DownloadList;
startDownload(txtUpdateFile, false);
break;
}
@@ -351,10 +351,10 @@ void UpdaterWindow::downloadCompleted()
mUpdateFiles = loadTxtFile(mUpdatesDir + "/" + txtUpdateFile);
}
- mDialogState = DialogState::DOWNLOAD_RESOURCES;
+ mDialogState = DialogState::DownloadResources;
break;
- case DialogState::DOWNLOAD_RESOURCES:
+ case DialogState::DownloadResources:
if (mUpdateIndex < mUpdateFiles.size())
{
const UpdateFile &thisFile = mUpdateFiles[mUpdateIndex];
@@ -390,13 +390,13 @@ void UpdaterWindow::downloadCompleted()
else
{
// Download of updates completed
- mDialogState = DialogState::DONE;
+ mDialogState = DialogState::Done;
enablePlay();
setLabel(_("Completed"));
}
break;
- case DialogState::DONE:
+ case DialogState::Done:
break;
}
}
diff --git a/src/gui/updaterwindow.h b/src/gui/updaterwindow.h
index 249da067..dd1400ba 100644
--- a/src/gui/updaterwindow.h
+++ b/src/gui/updaterwindow.h
@@ -102,14 +102,14 @@ private:
enum class DialogState
{
- DOWNLOAD_NEWS,
- DOWNLOAD_LIST,
- DOWNLOAD_RESOURCES,
- DONE,
+ DownloadNews,
+ DownloadList,
+ DownloadResources,
+ Done,
};
/** Status of the current download. */
- DialogState mDialogState = DialogState::DOWNLOAD_NEWS;
+ DialogState mDialogState = DialogState::DownloadNews;
/** Host where we get the updated files. */
std::string mUpdateHost;
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index 8f4ee686..9e529063 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -305,10 +305,10 @@ void Viewport::_drawDebugPath(Graphics *graphics)
unsigned char walkMask;
switch (Net::getNetworkType())
{
- case ServerType::TMWATHENA:
+ case ServerType::TmwAthena:
walkMask = Map::BLOCKMASK_WALL | Map::BLOCKMASK_CHARACTER;
break;
- case ServerType::MANASERV:
+ case ServerType::ManaServ:
default:
walkMask = Map::BLOCKMASK_WALL;
break;
@@ -575,18 +575,18 @@ void Viewport::updateCursorType()
gui->setCursorType(mHoverBeing->getHoverCursor());
break;
default:
- gui->setCursorType(Cursor::POINTER);
+ gui->setCursorType(Cursor::Pointer);
break;
}
// Item mouseover
}
else if (mHoverItem)
{
- gui->setCursorType(Cursor::PICKUP);
+ gui->setCursorType(Cursor::PickUp);
}
else
{
- gui->setCursorType(Cursor::POINTER);
+ gui->setCursorType(Cursor::Pointer);
}
}
diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp
index ef40d8c4..91366720 100644
--- a/src/gui/widgets/browserbox.cpp
+++ b/src/gui/widgets/browserbox.cpp
@@ -223,14 +223,14 @@ void BrowserBox::mousePressed(gcn::MouseEvent &event)
if (mHoveredLink) {
mLinkHandler->handleLink(mHoveredLink->link);
- gui->setCursorType(Cursor::POINTER);
+ gui->setCursorType(Cursor::Pointer);
}
}
void BrowserBox::mouseMoved(gcn::MouseEvent &event)
{
updateHoveredLink(event.getX(), event.getY());
- gui->setCursorType(mHoveredLink ? Cursor::HAND : Cursor::POINTER);
+ gui->setCursorType(mHoveredLink ? Cursor::Hand : Cursor::Pointer);
event.consume(); // Suppress mouse cursor change by parent
}
diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp
index 7d6f61f3..61ed7896 100644
--- a/src/gui/widgets/window.cpp
+++ b/src/gui/widgets/window.cpp
@@ -67,7 +67,7 @@ Window::Window(const std::string &caption, bool modal, Window *parent)
if (mModal)
{
- gui->setCursorType(Cursor::POINTER);
+ gui->setCursorType(Cursor::Pointer);
requestModalFocus();
}
@@ -294,7 +294,7 @@ void Window::widgetResized(const gcn::Event &event)
void Window::widgetHidden(const gcn::Event &event)
{
if (gui)
- gui->setCursorType(Cursor::POINTER);
+ gui->setCursorType(Cursor::Pointer);
WidgetListIterator it;
@@ -385,7 +385,7 @@ void Window::mouseReleased(gcn::MouseEvent &event)
void Window::mouseExited(gcn::MouseEvent &event)
{
if (mGrip && !mouseResize)
- gui->setCursorType(Cursor::POINTER);
+ gui->setCursorType(Cursor::Pointer);
mCloseButtonHovered = false;
}
@@ -404,7 +404,7 @@ void Window::mouseMoved(gcn::MouseEvent &event)
return;
mCloseButtonHovered = getCloseButtonRect().isPointInRect(event.getX(), event.getY());
- Cursor cursor = Cursor::POINTER;
+ Cursor cursor = Cursor::Pointer;
// Changes the custom mouse cursor based on its current position.
if (!mCloseButtonHovered)
@@ -413,19 +413,19 @@ void Window::mouseMoved(gcn::MouseEvent &event)
{
case BOTTOM | RIGHT:
case TOP | LEFT:
- cursor = Cursor::RESIZE_DOWN_RIGHT;
+ cursor = Cursor::ResizeDownRight;
break;
case BOTTOM | LEFT:
case TOP | RIGHT:
- cursor = Cursor::RESIZE_DOWN_LEFT;
+ cursor = Cursor::ResizeDownLeft;
break;
case BOTTOM:
case TOP:
- cursor = Cursor::RESIZE_DOWN;
+ cursor = Cursor::ResizeDown;
break;
case RIGHT:
case LEFT:
- cursor = Cursor::RESIZE_ACROSS;
+ cursor = Cursor::ResizeAcross;
break;
default:
break;