Style changes

This commit is contained in:
2026-07-20 20:05:29 +03:00
parent b3561e773d
commit 93bf97a15e
3 changed files with 34 additions and 45 deletions

View File

@@ -36,7 +36,7 @@ void GuiElementContainer::removeChild( GuiElement* element ) {
}
bool GuiElementContainer::containsPointInChildren(int x, int y) const {
for (std::vector<GuiElement*>::const_iterator it = children.begin(); it != children.end(); ++it) {
for (auto it = children.begin(); it != children.end(); ++it) {
GuiElement* child = *it;
if (child == NULL || !child->visible) continue;
if (child->pointInside(x, y)) return true;

View File

@@ -12,18 +12,7 @@
#include "../../../platform/input/Mouse.h"
#include "../../../util/Mth.h"
OptionsGroup::OptionsGroup( std::string labelID )
: contentHeight(0),
scrollOffsetY(0.0f),
maxScrollOffsetY(0.0f),
trackingScrollGesture(false),
scrollingGesture(false),
touchDispatched(false),
dragStartX(0),
dragStartY(0),
lastDragY(0),
touchStartX(0),
touchStartY(0) {
OptionsGroup::OptionsGroup( std::string labelID ) {
label = I18n::get(labelID);
}
@@ -36,7 +25,7 @@ void OptionsGroup::setupPositions() {
const int contentStartY = y + labelHeight;
// First we write the header and then we add the items
for(std::vector<GuiElement*>::iterator it = children.begin(); it != children.end(); ++it) {
for(auto it = children.begin(); it != children.end(); ++it) {
(*it)->width = width - 5;
(*it)->y = curY;

View File

@@ -32,17 +32,17 @@ protected:
void createKey(OptionId optId, Minecraft* minecraft);
std::string label;
int contentHeight;
float scrollOffsetY;
float maxScrollOffsetY;
bool trackingScrollGesture;
bool scrollingGesture;
bool touchDispatched;
int dragStartX;
int dragStartY;
int lastDragY;
int touchStartX;
int touchStartY;
int contentHeight = 0;
float scrollOffsetY = 0.f;
float maxScrollOffsetY = 0.f;
bool trackingScrollGesture = false;
bool scrollingGesture = false;
bool touchDispatched = false;
int dragStartX = 0;
int dragStartY = 0;
int lastDragY = 0;
int touchStartX = 0;
int touchStartY = 0;
static const int ScrollStartThreshold = 5;
};