Changeset View
Changeset View
Standalone View
Standalone View
src/actionbar.cpp
Show All 25 Lines | |||||
26 | #include <QGraphicsProxyWidget> | 26 | #include <QGraphicsProxyWidget> | ||
27 | 27 | | |||
28 | ActionBar::ActionBar(WorksheetEntry* parent) | 28 | ActionBar::ActionBar(WorksheetEntry* parent) | ||
29 | : QGraphicsObject(parent) | 29 | : QGraphicsObject(parent) | ||
30 | { | 30 | { | ||
31 | m_pos = 0; | 31 | m_pos = 0; | ||
32 | m_height = 0; | 32 | m_height = 0; | ||
33 | QPointF p = worksheet()->worksheetView()->viewRect().topRight(); | 33 | QPointF p = worksheet()->worksheetView()->viewRect().topRight(); | ||
34 | qreal w = qMin(parent->size().width(), | 34 | qreal w = qMin(parent->size().width() - WorksheetEntry::RightMargin, | ||
asemke: spaces around the operators are not consistently used in Cantor's code nor in this patch. Let's… | |||||
35 | parent->mapFromScene(p).x()); | 35 | parent->mapFromScene(p).x()); | ||
36 | setPos(w, 0); | 36 | setPos(w, 0); | ||
37 | connect(worksheet()->worksheetView(), SIGNAL(viewRectChanged(QRectF)), | 37 | connect(worksheet()->worksheetView(), SIGNAL(viewRectChanged(QRectF)), | ||
38 | this, SLOT(updatePosition())); | 38 | this, SLOT(updatePosition())); | ||
39 | } | 39 | } | ||
40 | 40 | | |||
41 | WorksheetToolButton* ActionBar::addButton(const QIcon& icon, const QString& toolTip, | 41 | WorksheetToolButton* ActionBar::addButton(const QIcon& icon, const QString& toolTip, | ||
42 | QObject* receiver, const char* method ) | 42 | QObject* receiver, const char* method ) | ||
Show All 16 Lines | 58 | { | |||
59 | m_pos -= 8; | 59 | m_pos -= 8; | ||
60 | } | 60 | } | ||
61 | 61 | | |||
62 | void ActionBar::updatePosition() | 62 | void ActionBar::updatePosition() | ||
63 | { | 63 | { | ||
64 | if (!parentEntry()) | 64 | if (!parentEntry()) | ||
65 | return; | 65 | return; | ||
66 | QPointF p = worksheet()->worksheetView()->viewRect().topRight(); | 66 | QPointF p = worksheet()->worksheetView()->viewRect().topRight(); | ||
67 | qreal w = qMin(parentEntry()->size().width(), | 67 | qreal w = qMin(parentEntry()->size().width() - WorksheetEntry::RightMargin, | ||
68 | parentEntry()->mapFromScene(p).x()); | 68 | parentEntry()->mapFromScene(p).x()); | ||
69 | setPos(w, 0); | 69 | setPos(w, 0); | ||
70 | const qreal scale = worksheet()->renderer()->scale(); | 70 | const qreal scale = worksheet()->renderer()->scale(); | ||
71 | foreach(WorksheetToolButton* button, m_buttons) { | 71 | foreach(WorksheetToolButton* button, m_buttons) { | ||
72 | button->setIconScale(scale); | 72 | button->setIconScale(scale); | ||
73 | } | 73 | } | ||
74 | } | 74 | } | ||
75 | 75 | | |||
Show All 18 Lines |
spaces around the operators are not consistently used in Cantor's code nor in this patch. Let's consistently use spaces around every operator.