示例#1
0
文件: madpdf.c 项目: avm/madpdf
static void move_vscrollbar(Ewl_Scrollpane *s, double direction)
{
    double rel, abs;
    get_vertical_pan_inc(&rel, &abs);
    rel *= direction;
    ewl_scrollpane_vscrollbar_value_set(s,
            scroll_pos_add(ewl_scrollpane_vscrollbar_value_get(s), rel));
    display_hint(-abs * direction);
    update_statusbar();
}
示例#2
0
文件: madpdf.c 项目: avm/madpdf
/* Swap scrollbar values after an orientation change.
 * direction == -1 -> turn clockwise, 1 -> counter-clockwise. */
static void turn_scrollbars(Ewl_Scrollpane *s, int direction)
{
    double h = from_scroll_position(ewl_scrollpane_hscrollbar_value_get(s));
    double v = from_scroll_position(ewl_scrollpane_vscrollbar_value_get(s));

    double new_h =  v * direction;
    double new_v = -h * direction;

    ewl_scrollpane_hscrollbar_value_set(s, to_scroll_position(new_h));
    ewl_scrollpane_vscrollbar_value_set(s, to_scroll_position(new_v));
    update_statusbar();
}
示例#3
0
文件: madpdf.c 项目: quickhand/madpdf
static void move_vscrollbar(Ewl_Scrollpane *s, double amount)
{
    ewl_scrollpane_vscrollbar_value_set(s,
            clamp(0.0, ewl_scrollpane_vscrollbar_value_get(s) + amount, 1.0));
    update_statusbar();
}