diff --git a/input/input_state.cpp b/input/input_state.cpp index 3261f3882..2a75fbc2b 100644 --- a/input/input_state.cpp +++ b/input/input_state.cpp @@ -8,6 +8,7 @@ const char *GetDeviceName(int deviceId) { case DEVICE_ID_PAD_0: return "pad"; case DEVICE_ID_X360_0: return "x360"; case DEVICE_ID_ACCELEROMETER: return "accelerometer"; + case DEVICE_ID_MOUSE: return "mouse"; default: return "unknown"; } diff --git a/ui/ui_screen.h b/ui/ui_screen.h index f1999f6c7..5ac4c2960 100644 --- a/ui/ui_screen.h +++ b/ui/ui_screen.h @@ -63,16 +63,16 @@ private: class ListPopupScreen : public PopupScreen { public: - ListPopupScreen(std::string title) : PopupScreen(title) {} - ListPopupScreen(std::string title, const std::vector &items, int selected, std::function callback) - : PopupScreen(title), adaptor_(items, selected), callback_(callback) { + ListPopupScreen(std::string title) : PopupScreen(title), showButtons_(false) {} + ListPopupScreen(std::string title, const std::vector &items, int selected, std::function callback, bool showButtons = false) + : PopupScreen(title), adaptor_(items, selected), callback_(callback), showButtons_(showButtons) { } UI::Event OnChoice; protected: virtual bool FillVertical() { return true; } - virtual bool ShowButtons() { return false; } + virtual bool ShowButtons() { return showButtons_; } void CreatePopupContents(UI::ViewGroup *parent); UI::StringVectorListAdaptor adaptor_; UI::ListView *listView_; @@ -81,6 +81,7 @@ private: UI::EventReturn OnListChoice(UI::EventParams &e); std::function callback_; + bool showButtons_; }; class MessagePopupScreen : public PopupScreen { diff --git a/ui/view.cpp b/ui/view.cpp index caae38cdb..8e17e4860 100644 --- a/ui/view.cpp +++ b/ui/view.cpp @@ -507,7 +507,7 @@ void SliderFloat::Key(const KeyInput &input) { void SliderFloat::Touch(const TouchInput &input) { if (dragging_ || bounds_.Contains(input.x, input.y)) { float relativeX = (input.x - bounds_.x) / bounds_.w; - *value_ = floorf(relativeX * (maxValue_ - minValue_) + minValue_ + 0.5f); + *value_ = relativeX * (maxValue_ - minValue_) + minValue_; Clamp(); } }