Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/ant/ant/RulerConfigPage4.ui
Original file line number Diff line number Diff line change
Expand Up @@ -594,12 +594,12 @@
</widget>
</item>
<item row="10" column="1">
<widget class="QCheckBox" name="t_snap_cbx">
<widget class="QCheckBox" name="t_never_snap_cbx">
<property name="toolTip">
<string>If checked, snap to edges or vertices of objects unless disabled above</string>
</property>
<property name="text">
<string>Snap to objects</string>
<string>Never snap to objects</string>
</property>
</widget>
</item>
Expand Down Expand Up @@ -893,7 +893,7 @@
<tabstop>style_cb</tabstop>
<tabstop>outline_cb</tabstop>
<tabstop>t_angle_cb</tabstop>
<tabstop>t_snap_cbx</tabstop>
<tabstop>t_never_snap_cbx</tabstop>
</tabstops>
<resources>
<include location="../../icons/icons.qrc"/>
Expand Down
242 changes: 242 additions & 0 deletions src/ant/ant/RulerOptions.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,242 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>RulerOptions</class>
<widget class="QWidget" name="RulerOptions">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>446</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Ignored">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QScrollArea" name="scrollArea">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>446</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>2</number>
</property>
<property name="leftMargin">
<number>4</number>
</property>
<property name="topMargin">
<number>4</number>
</property>
<property name="rightMargin">
<number>4</number>
</property>
<property name="bottomMargin">
<number>4</number>
</property>
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Snapping</string>
</property>
<layout class="QGridLayout" name="_5">
<property name="leftMargin">
<number>4</number>
</property>
<property name="topMargin">
<number>4</number>
</property>
<property name="rightMargin">
<number>4</number>
</property>
<property name="bottomMargin">
<number>4</number>
</property>
<property name="horizontalSpacing">
<number>6</number>
</property>
<property name="verticalSpacing">
<number>2</number>
</property>
<item row="0" column="0" colspan="2">
<widget class="QCheckBox" name="snap_to_grid_cbx">
<property name="text">
<string>Snap to grid</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QCheckBox" name="snap_to_objects_cbx">
<property name="text">
<string>Snap to edge/vertex</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Angle Constraints</string>
</property>
<layout class="QGridLayout" name="_2">
<property name="leftMargin">
<number>4</number>
</property>
<property name="topMargin">
<number>4</number>
</property>
<property name="rightMargin">
<number>4</number>
</property>
<property name="bottomMargin">
<number>4</number>
</property>
<property name="horizontalSpacing">
<number>6</number>
</property>
<property name="verticalSpacing">
<number>2</number>
</property>
<item row="0" column="1">
<widget class="QComboBox" name="angle_cb">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="sizeAdjustPolicy">
<enum>QComboBox::AdjustToContents</enum>
</property>
<item>
<property name="text">
<string>Any Angle</string>
</property>
</item>
<item>
<property name="text">
<string>Diagonal</string>
</property>
</item>
<item>
<property name="text">
<string>Diagonal only</string>
</property>
</item>
<item>
<property name="text">
<string>Orthogonal</string>
</property>
</item>
<item>
<property name="text">
<string>Horizontal only</string>
</property>
</item>
<item>
<property name="text">
<string>Vertical only</string>
</property>
</item>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Ruler direction</string>
</property>
</widget>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Note: certain rulers may ignore these options</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="spacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>121</width>
<height>70</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<tabstops>
<tabstop>scrollArea</tabstop>
<tabstop>snap_to_grid_cbx</tabstop>
<tabstop>snap_to_objects_cbx</tabstop>
<tabstop>angle_cb</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>
3 changes: 3 additions & 0 deletions src/ant/ant/ant.pro
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ FORMS = \
RulerConfigPage3.ui \
RulerConfigPage4.ui \
RulerPropertiesPage.ui \
RulerOptions.ui \

}

Expand All @@ -22,10 +23,12 @@ FORMS = \
HEADERS = \
antConfigPage.h \
antPropertiesPage.h \
antRulerOptionsPage.h

SOURCES = \
antConfigPage.cc \
antPropertiesPage.cc \
antRulerOptionsPage.cc

# Enabled without Qt:

Expand Down
4 changes: 2 additions & 2 deletions src/ant/ant/antConfigPage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ ConfigPage4::show ()
mp_ui->style_cb->setCurrentIndex ((unsigned int) m_ruler_templates [m_current_template].style ());
mp_ui->outline_cb->setCurrentIndex ((unsigned int) m_ruler_templates [m_current_template].outline ());
mp_ui->t_angle_cb->setCurrentIndex ((unsigned int) m_ruler_templates [m_current_template].angle_constraint ());
mp_ui->t_snap_cbx->setChecked (m_ruler_templates [m_current_template].snap ());
mp_ui->t_never_snap_cbx->setChecked (! m_ruler_templates [m_current_template].snap ());
mp_ui->t_mode_cb->setCurrentIndex ((unsigned int) m_ruler_templates [m_current_template].mode ());

mp_ui->main_position->setCurrentIndex ((unsigned int) m_ruler_templates [m_current_template].main_position ());
Expand Down Expand Up @@ -410,7 +410,7 @@ ConfigPage4::commit ()
ant::Template::ruler_mode_type mode = ant::Template::ruler_mode_type (mp_ui->t_mode_cb->currentIndex ());
m_ruler_templates [m_current_template].set_mode (mode);

m_ruler_templates [m_current_template].snap (mp_ui->t_snap_cbx->isChecked ());
m_ruler_templates [m_current_template].snap (! mp_ui->t_never_snap_cbx->isChecked ());

m_ruler_templates [m_current_template].set_main_position (Object::position_type (mp_ui->main_position->currentIndex ()));
m_ruler_templates [m_current_template].set_main_xalign (Object::alignment_type (mp_ui->main_xalign->currentIndex ()));
Expand Down
6 changes: 3 additions & 3 deletions src/ant/ant/antPlugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "layConverters.h"
#include "layDispatcher.h"
#include "layAbstractMenu.h"
#include "layLayoutViewBase.h"
#include "tlColor.h"
#include "tlLog.h"
#if defined(HAVE_QT)
Expand Down Expand Up @@ -139,11 +140,10 @@ PluginDeclaration::create_plugin (db::Manager *manager, lay::Dispatcher *, lay::
}

std::vector<std::string>
PluginDeclaration::additional_editor_options_pages () const
PluginDeclaration::additional_editor_options_pages (lay::LayoutViewBase * /*view*/) const
{
std::vector<std::string> names;
// TODO: provide in a central place instead of borrowing from the edt module
names.push_back ("GenericEditorOptions");
names.push_back ("ant::RulerOptions");
return names;
}

Expand Down
2 changes: 1 addition & 1 deletion src/ant/ant/antPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class PluginDeclaration
virtual void uninitialize (lay::Dispatcher *);
virtual bool menu_activated (const std::string &symbol) const;

virtual std::vector<std::string> additional_editor_options_pages () const;
virtual std::vector<std::string> additional_editor_options_pages (lay::LayoutViewBase *view) const;

void register_annotation_template (const ant::Template &t, lay::Plugin *plugin = 0);
void unregister_annotation_template (const std::string &category, lay::Plugin *plugin = 0);
Expand Down
Loading
Loading