mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-29 01:20:17 +00:00
Enable "Use native mouse cursors" option if the platform supports native cursors
This commit is contained in:
parent
daf1e3fb3e
commit
c947425051
@ -136,7 +136,9 @@ public:
|
|||||||
if (m_pref.selection.moveEdges())
|
if (m_pref.selection.moveEdges())
|
||||||
moveEdges()->setSelected(true);
|
moveEdges()->setSelected(true);
|
||||||
|
|
||||||
#if defined(_WIN32) || defined(__APPLE__)
|
// If the platform supports native cursors...
|
||||||
|
if ((int(she::instance()->capabilities()) &
|
||||||
|
int(she::Capabilities::CustomNativeMouseCursor)) != 0) {
|
||||||
if (m_pref.cursor.useNativeCursor())
|
if (m_pref.cursor.useNativeCursor())
|
||||||
nativeCursor()->setSelected(true);
|
nativeCursor()->setSelected(true);
|
||||||
nativeCursor()->Click.connect(base::Bind<void>(&OptionsWindow::onNativeCursorChange, this));
|
nativeCursor()->Click.connect(base::Bind<void>(&OptionsWindow::onNativeCursorChange, this));
|
||||||
@ -144,10 +146,11 @@ public:
|
|||||||
cursorScale()->setSelectedItemIndex(
|
cursorScale()->setSelectedItemIndex(
|
||||||
cursorScale()->findItemIndexByValue(
|
cursorScale()->findItemIndexByValue(
|
||||||
base::convert_to<std::string>(m_pref.cursor.cursorScale())));
|
base::convert_to<std::string>(m_pref.cursor.cursorScale())));
|
||||||
#else
|
}
|
||||||
// TODO impl this on Linux
|
else {
|
||||||
nativeCursor()->setEnabled(false);
|
nativeCursor()->setEnabled(false);
|
||||||
#endif
|
}
|
||||||
|
|
||||||
onNativeCursorChange();
|
onNativeCursorChange();
|
||||||
|
|
||||||
if (m_pref.experimental.useNativeFileDialog())
|
if (m_pref.experimental.useNativeFileDialog())
|
||||||
@ -379,11 +382,13 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void onNativeCursorChange() {
|
void onNativeCursorChange() {
|
||||||
#if defined(_WIN32) || defined(__APPLE__)
|
bool state =
|
||||||
bool state = !nativeCursor()->isSelected();
|
// If the platform supports native cursors...
|
||||||
#else
|
(((int(she::instance()->capabilities()) &
|
||||||
bool state = false;
|
int(she::Capabilities::CustomNativeMouseCursor)) != 0) &&
|
||||||
#endif
|
// If the native cursor option is not selec
|
||||||
|
!nativeCursor()->isSelected());
|
||||||
|
|
||||||
cursorScaleLabel()->setEnabled(state);
|
cursorScaleLabel()->setEnabled(state);
|
||||||
cursorScale()->setEnabled(state);
|
cursorScale()->setEnabled(state);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user