mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Code to get cocoa transient scroller setting
This commit is contained in:
parent
ebba389a6a
commit
c139aac5ab
@ -115,3 +115,8 @@ cocoa_cursor_blink_time(void) {
|
||||
}
|
||||
return ans > max_value ? 0.0 : ans;
|
||||
}
|
||||
|
||||
int
|
||||
cocoa_transient_scroller(void) {
|
||||
return [NSScroller preferredScrollerStyle] == NSScrollerStyleOverlay;
|
||||
}
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
#include <Python.h>
|
||||
|
||||
extern int cocoa_transient_scroller(void);
|
||||
extern double cocoa_cursor_blink_time(void);
|
||||
extern void cocoa_send_notification(const char *identitifer, const char *title, const char *subtitle, const char *informativeText, const char* path_to_image);
|
||||
extern const char* cocoa_send2trash(const char *utf8_path);
|
||||
@ -16,6 +17,12 @@ extern void remove_cocoa_menu_items(void);
|
||||
|
||||
static PyObject *notification_activated_callback = NULL;
|
||||
|
||||
static PyObject*
|
||||
transient_scroller(PyObject *self) {
|
||||
(void)self;
|
||||
return PyBool_FromLong(cocoa_transient_scroller());
|
||||
}
|
||||
|
||||
static PyObject*
|
||||
cursor_blink_time(PyObject *self) {
|
||||
(void)self;
|
||||
@ -84,6 +91,7 @@ disable_cocoa_ui_elements(PyObject *self, PyObject *args) {
|
||||
|
||||
|
||||
static PyMethodDef module_methods[] = {
|
||||
{"transient_scroller", (PyCFunction)transient_scroller, METH_NOARGS, ""},
|
||||
{"cursor_blink_time", (PyCFunction)cursor_blink_time, METH_NOARGS, ""},
|
||||
{"enable_cocoa_multithreading", (PyCFunction)enable_cocoa_multithreading, METH_NOARGS, ""},
|
||||
{"set_notification_activated_callback", (PyCFunction)set_notification_activated_callback, METH_O, ""},
|
||||
|
Loading…
x
Reference in New Issue
Block a user