1
// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
3
* Copyright (C) 2014 Canonical Ltd
5
* This program is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 3 as
7
* published by the Free Software Foundation.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
* Authored by: Marco Trevisan <marco.trevisan@canonical.com>
20
#include "OverlayScrollView.h"
21
#include "PlacesOverlayVScrollBar.h"
30
const RawPixel MOUSE_WHEEL_SCROLL_SIZE = 32_em;
33
ScrollView::ScrollView(NUX_FILE_LINE_DECL)
34
: nux::ScrollView(NUX_FILE_LINE_PARAM)
36
auto* scrollbar = new PlacesOverlayVScrollBar(NUX_TRACKER_LOCATION);
37
SetVScrollBar(scrollbar);
39
scale.SetGetterFunction([scrollbar] { return scrollbar->scale(); });
40
scale.SetSetterFunction([scrollbar] (double scale) {
41
if (scrollbar->scale() == scale)
44
scrollbar->scale = scale;
48
m_MouseWheelScrollSize = MOUSE_WHEEL_SCROLL_SIZE.CP(scale);
50
scale.changed.connect([this] (double scale) {
51
m_MouseWheelScrollSize = MOUSE_WHEEL_SCROLL_SIZE.CP(scale);
b'\\ No newline at end of file'