mirror of https://github.com/KLayout/klayout.git
Merge b39556d645 into 072b02c55c
This commit is contained in:
commit
0c48fcc8ba
|
|
@ -2288,7 +2288,7 @@ bool
|
|||
PartialService::key_event (unsigned int key, unsigned int buttons)
|
||||
{
|
||||
if (m_moving && buttons == 0 && (key == lay::KeyEnter || key == lay::KeyReturn)) {
|
||||
mp_view->move_service ()->end_move ();
|
||||
mp_view->move_service ()->finish_move ();
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -389,9 +389,13 @@ BitmapRenderer::draw (const db::Shape &shape, const db::CplxTrans &trans,
|
|||
db::DCoord h = trans.mag () * m_default_text_size;
|
||||
db::Font font = shape.text_font () == db::NoFont ? m_font : shape.text_font ();
|
||||
|
||||
if (m_apply_text_trans && font != db::NoFont && font != db::DefaultFont) {
|
||||
fp = db::DFTrans (trans.fp_trans () * shape.text_trans ());
|
||||
h = trans.mag () * (shape.text_size () > 0 ? shape.text_size () : m_default_text_size);
|
||||
if (font != db::NoFont && font != db::DefaultFont) {
|
||||
if ((m_apply_text_trans_mode & 2) != 0) {
|
||||
fp = db::DFTrans (trans.fp_trans () * shape.text_trans ());
|
||||
}
|
||||
if ((m_apply_text_trans_mode & 1) != 0) {
|
||||
h = trans.mag () * (shape.text_size () > 0 ? shape.text_size () : m_default_text_size);
|
||||
}
|
||||
}
|
||||
|
||||
db::HAlign halign = shape.text_halign ();
|
||||
|
|
@ -1090,9 +1094,13 @@ BitmapRenderer::draw (const db::Text &txt, const db::CplxTrans &trans,
|
|||
db::DCoord h = trans.mag () * m_default_text_size;
|
||||
db::Font font = txt.font () == db::NoFont ? m_font : txt.font ();
|
||||
|
||||
if (m_apply_text_trans && font != db::NoFont && font != db::DefaultFont) {
|
||||
fp = db::DFTrans (trans.fp_trans () * txt.trans ());
|
||||
h = trans.mag () * (txt.size () > 0 ? txt.size () : m_default_text_size);
|
||||
if (font != db::NoFont && font != db::DefaultFont) {
|
||||
if ((m_apply_text_trans_mode & 2) != 0) {
|
||||
fp = db::DFTrans (trans.fp_trans () * txt.trans ());
|
||||
}
|
||||
if ((m_apply_text_trans_mode & 1) != 0) {
|
||||
h = trans.mag () * (txt.size () > 0 ? txt.size () : m_default_text_size);
|
||||
}
|
||||
}
|
||||
|
||||
double fy = 0.0;
|
||||
|
|
@ -1161,9 +1169,13 @@ BitmapRenderer::draw (const db::DText &txt, const db::DCplxTrans &trans,
|
|||
db::DCoord h = trans.ctrans (m_default_text_size_dbl);
|
||||
db::Font font = txt.font () == db::NoFont ? m_font : txt.font ();
|
||||
|
||||
if (m_apply_text_trans && font != db::NoFont && font != db::DefaultFont) {
|
||||
fp = trans.fp_trans () * db::DFTrans (txt.trans ());
|
||||
h = trans.ctrans (txt.size () > 0 ? txt.size () : m_default_text_size_dbl);
|
||||
if (font != db::NoFont && font != db::DefaultFont) {
|
||||
if ((m_apply_text_trans_mode & 2) != 0) {
|
||||
fp = trans.fp_trans () * db::DFTrans (txt.trans ());
|
||||
}
|
||||
if ((m_apply_text_trans_mode & 1) != 0) {
|
||||
h = trans.ctrans (txt.size () > 0 ? txt.size () : m_default_text_size_dbl);
|
||||
}
|
||||
}
|
||||
|
||||
double fy = 0.0;
|
||||
|
|
|
|||
|
|
@ -351,6 +351,7 @@ LayoutViewBase::init (db::Manager *mgr)
|
|||
m_bitmap_caching = true;
|
||||
m_show_properties = false;
|
||||
m_apply_text_trans = true;
|
||||
m_apply_text_trans_mode = 3;
|
||||
m_default_text_size = 0.1;
|
||||
m_text_point_mode = false;
|
||||
m_text_font = 0;
|
||||
|
|
@ -1029,6 +1030,13 @@ LayoutViewBase::configure (const std::string &name, const std::string &value)
|
|||
apply_text_trans (flag);
|
||||
return true;
|
||||
|
||||
} else if (name == cfg_apply_text_trans_mode) {
|
||||
|
||||
unsigned int mode;
|
||||
tl::from_string (value, mode);
|
||||
apply_text_trans_mode (mode);
|
||||
return true;
|
||||
|
||||
} else if (name == cfg_markers_visible) {
|
||||
|
||||
bool flag;
|
||||
|
|
@ -5541,7 +5549,16 @@ LayoutViewBase::apply_text_trans (bool f)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
LayoutViewBase::apply_text_trans_mode (unsigned int m)
|
||||
{
|
||||
if (m_apply_text_trans_mode != m) {
|
||||
m_apply_text_trans_mode = m;
|
||||
redraw ();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
LayoutViewBase::offset_stipples (bool f)
|
||||
{
|
||||
if (m_stipple_offset != f) {
|
||||
|
|
|
|||
|
|
@ -1400,6 +1400,26 @@ public:
|
|||
return m_apply_text_trans;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Sets the mode how to apply the text transformation
|
||||
*
|
||||
* The mode value has two bits:
|
||||
* - bit 0: apply scaling
|
||||
* - bit 1: apply rotation
|
||||
*
|
||||
* The default is mode "3" (scaling and rotation).
|
||||
* The mode is effective only if "apply_text_trans" is true.
|
||||
*/
|
||||
void apply_text_trans_mode (unsigned int m);
|
||||
|
||||
/**
|
||||
* @brief Gets the mode how to apply the text transformation
|
||||
*/
|
||||
unsigned int apply_text_trans_mode () const
|
||||
{
|
||||
return m_apply_text_trans ? m_apply_text_trans_mode : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Text object color
|
||||
*/
|
||||
|
|
@ -3074,6 +3094,7 @@ private:
|
|||
bool m_show_properties;
|
||||
tl::Color m_text_color;
|
||||
bool m_apply_text_trans;
|
||||
unsigned int m_apply_text_trans_mode;
|
||||
double m_default_text_size;
|
||||
bool m_text_point_mode;
|
||||
unsigned int m_text_font;
|
||||
|
|
|
|||
|
|
@ -67,6 +67,7 @@ public:
|
|||
options.push_back (std::pair<std::string, std::string> (cfg_bitmap_caching, "true"));
|
||||
options.push_back (std::pair<std::string, std::string> (cfg_show_properties, "false"));
|
||||
options.push_back (std::pair<std::string, std::string> (cfg_apply_text_trans, "true"));
|
||||
options.push_back (std::pair<std::string, std::string> (cfg_apply_text_trans_mode, "3"));
|
||||
options.push_back (std::pair<std::string, std::string> (cfg_global_trans, "r0"));
|
||||
options.push_back (std::pair<std::string, std::string> (cfg_default_text_size, "0.1"));
|
||||
options.push_back (std::pair<std::string, std::string> (cfg_text_point_mode, "false"));
|
||||
|
|
|
|||
|
|
@ -640,7 +640,7 @@ ShapeMarker::render (const Viewport &vp, ViewObjectCanvas &canvas)
|
|||
lay::Renderer &r = canvas.renderer ();
|
||||
|
||||
r.set_font (db::Font (view ()->text_font ()));
|
||||
r.apply_text_trans (view ()->apply_text_trans ());
|
||||
r.apply_text_trans_mode (view ()->apply_text_trans_mode ());
|
||||
r.default_text_size (view ()->default_text_size () / ly->dbu ());
|
||||
r.set_precise (true);
|
||||
|
||||
|
|
@ -1171,7 +1171,7 @@ Marker::render (const Viewport &vp, ViewObjectCanvas &canvas)
|
|||
lay::Renderer &r = canvas.renderer ();
|
||||
|
||||
r.set_font (db::Font (view ()->text_font ()));
|
||||
r.apply_text_trans (view ()->apply_text_trans ());
|
||||
r.apply_text_trans_mode (view ()->apply_text_trans_mode ());
|
||||
r.default_text_size (view ()->default_text_size () / dbu ());
|
||||
r.set_precise (true);
|
||||
|
||||
|
|
@ -1319,7 +1319,7 @@ DMarker::render (const Viewport &vp, ViewObjectCanvas &canvas)
|
|||
lay::Renderer &r = canvas.renderer ();
|
||||
|
||||
r.set_font (db::Font (view ()->text_font ()));
|
||||
r.apply_text_trans (view ()->apply_text_trans ());
|
||||
r.apply_text_trans_mode (view ()->apply_text_trans_mode ());
|
||||
r.default_text_size_dbl (view ()->default_text_size ());
|
||||
r.set_precise (true);
|
||||
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ MoveService::key_event (unsigned int key, unsigned int buttons)
|
|||
}
|
||||
|
||||
if (buttons == 0 && (key == lay::KeyEnter || key == lay::KeyReturn)) {
|
||||
end_move ();
|
||||
finish_move ();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -378,7 +378,7 @@ MoveService::start_move (db::Transaction *transaction, bool transient_selection)
|
|||
}
|
||||
|
||||
void
|
||||
MoveService::end_move ()
|
||||
MoveService::finish_move ()
|
||||
{
|
||||
if (m_dragging) {
|
||||
handle_click (m_mouse_pos, 0, false, 0);
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ public:
|
|||
~MoveService ();
|
||||
|
||||
bool start_move (db::Transaction *transaction = 0, bool transient_selection = false);
|
||||
void end_move ();
|
||||
void finish_move ();
|
||||
|
||||
bool configure (const std::string &name, const std::string &value);
|
||||
void function (const std::string &name, const std::string &value);
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ RedrawThreadWorker::RedrawThreadWorker (RedrawThread *redraw_thread)
|
|||
m_text_lazy_rendering = false;
|
||||
m_bitmap_caching = false;
|
||||
m_show_properties = false;
|
||||
m_apply_text_trans = false;
|
||||
m_apply_text_trans_mode = 0;
|
||||
m_default_text_size = 0.0;
|
||||
m_drop_small_cells = false;
|
||||
m_drop_small_cells_value = 0;
|
||||
|
|
@ -291,7 +291,7 @@ RedrawThreadWorker::perform_task (tl::Task *task)
|
|||
mp_renderer->draw_description_property (false);
|
||||
mp_renderer->default_text_size (m_default_text_size / mp_layout->dbu ());
|
||||
mp_renderer->set_font (db::Font (m_text_font));
|
||||
mp_renderer->apply_text_trans (m_apply_text_trans);
|
||||
mp_renderer->apply_text_trans_mode (m_apply_text_trans_mode);
|
||||
|
||||
for (std::vector<db::DCplxTrans>::const_iterator t = li.trans.begin (); t != li.trans.end (); ++t) {
|
||||
db::CplxTrans trans = m_vp_trans * *t * db::CplxTrans (mp_layout->dbu ());
|
||||
|
|
@ -533,7 +533,7 @@ RedrawThreadWorker::perform_task (tl::Task *task)
|
|||
mp_renderer->draw_description_property (true);
|
||||
mp_renderer->default_text_size (db::Coord (m_default_text_size / mp_layout->dbu ()));
|
||||
mp_renderer->set_font (db::Font (m_text_font));
|
||||
mp_renderer->apply_text_trans (m_apply_text_trans);
|
||||
mp_renderer->apply_text_trans_mode (m_apply_text_trans_mode);
|
||||
|
||||
bool f = m_text_lazy_rendering;
|
||||
|
||||
|
|
@ -693,7 +693,7 @@ RedrawThreadWorker::setup (LayoutViewBase *view, RedrawThreadCanvas *canvas, con
|
|||
m_text_lazy_rendering = view->text_lazy_rendering ();
|
||||
m_bitmap_caching = view->bitmap_caching ();
|
||||
m_show_properties = view->show_properties_as_text ();
|
||||
m_apply_text_trans = view->apply_text_trans ();
|
||||
m_apply_text_trans_mode = view->apply_text_trans_mode ();
|
||||
m_default_text_size = view->default_text_size ();
|
||||
m_drop_small_cells = view->drop_small_cells ();
|
||||
m_drop_small_cells_value = view->drop_small_cells_value ();
|
||||
|
|
|
|||
|
|
@ -224,7 +224,7 @@ private:
|
|||
bool m_text_lazy_rendering;
|
||||
bool m_bitmap_caching;
|
||||
bool m_show_properties;
|
||||
bool m_apply_text_trans;
|
||||
unsigned int m_apply_text_trans_mode;
|
||||
double m_default_text_size;
|
||||
bool m_drop_small_cells;
|
||||
unsigned int m_drop_small_cells_value;
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ Renderer::Renderer (unsigned int width, unsigned int height, double resolution,
|
|||
m_draw_description_property (false),
|
||||
m_default_text_size (1000),
|
||||
m_default_text_size_dbl (1.0),
|
||||
m_apply_text_trans (true),
|
||||
m_apply_text_trans_mode (3),
|
||||
m_precise (false),
|
||||
m_xfill (false),
|
||||
m_font (db::DefaultFont),
|
||||
|
|
|
|||
|
|
@ -164,19 +164,23 @@ public:
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief Apply text transformations to text or not for draw(db::Text..).
|
||||
* @brief How to apply text transformations for draw(db::Text..).
|
||||
*
|
||||
* This is a bit field:
|
||||
* - bit 0: apply scaling
|
||||
* - bit 1: apply rotation
|
||||
*/
|
||||
void apply_text_trans (bool f)
|
||||
void apply_text_trans_mode (unsigned int m)
|
||||
{
|
||||
m_apply_text_trans = f;
|
||||
m_apply_text_trans_mode = m;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the flag which determines to apply text transformations for draw(db::Text..)
|
||||
* @brief Get the value indicating how to apply text transformation for draw(db::Text..).
|
||||
*/
|
||||
bool apply_text_trans () const
|
||||
unsigned int apply_text_trans_mode () const
|
||||
{
|
||||
return m_apply_text_trans;
|
||||
return m_apply_text_trans_mode;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -415,7 +419,7 @@ protected:
|
|||
bool m_draw_description_property;
|
||||
db::DCoord m_default_text_size;
|
||||
double m_default_text_size_dbl;
|
||||
bool m_apply_text_trans;
|
||||
unsigned int m_apply_text_trans_mode;
|
||||
bool m_precise;
|
||||
bool m_xfill;
|
||||
db::Font m_font;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ namespace lay
|
|||
TextInfo::TextInfo (const LayoutViewBase *view)
|
||||
: m_default_text_size (view->default_text_size ()),
|
||||
m_default_font (db::Font (view->text_font ())),
|
||||
m_apply_text_trans (view->apply_text_trans ()),
|
||||
m_apply_text_trans_mode (view->apply_text_trans_mode ()),
|
||||
m_resolution (view->canvas ()->font_resolution ()),
|
||||
m_point_mode (view->text_point_mode ())
|
||||
{
|
||||
|
|
@ -49,14 +49,18 @@ TextInfo::bbox (const db::DText &text, const db::DCplxTrans &vp_trans) const
|
|||
// offset in pixels (space between origin and text)
|
||||
const double offset = 2.0 / vp_trans.mag ();
|
||||
|
||||
db::DTrans tt = text.trans ();
|
||||
db::DTrans tt;
|
||||
db::DCoord h;
|
||||
db::Font font = text.font () == db::NoFont ? m_default_font : text.font ();
|
||||
|
||||
if (m_apply_text_trans && font != db::NoFont && font != db::DefaultFont) {
|
||||
if ((m_apply_text_trans_mode & 2) != 0 && font != db::NoFont && font != db::DefaultFont) {
|
||||
tt = text.trans ();
|
||||
} else {
|
||||
tt = db::DTrans (vp_trans.fp_trans ().inverted ().angle (), text.trans ().disp ());
|
||||
}
|
||||
if (((m_apply_text_trans_mode & 1) != 0) && font != db::NoFont && font != db::DefaultFont) {
|
||||
h = text.size () > 0 ? text.size () : m_default_text_size;
|
||||
} else {
|
||||
tt = db::DTrans (vp_trans.fp_trans ().inverted ().angle (), tt.disp ());
|
||||
h = m_default_text_size;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ public:
|
|||
private:
|
||||
double m_default_text_size;
|
||||
db::Font m_default_font;
|
||||
bool m_apply_text_trans;
|
||||
unsigned int m_apply_text_trans_mode;
|
||||
double m_resolution;
|
||||
bool m_point_mode;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -103,6 +103,7 @@ static const std::string cfg_text_lazy_rendering ("text-lazy-rendering");
|
|||
static const std::string cfg_bitmap_caching ("bitmap-caching");
|
||||
static const std::string cfg_show_properties ("show-properties");
|
||||
static const std::string cfg_apply_text_trans ("apply-text-trans");
|
||||
static const std::string cfg_apply_text_trans_mode ("apply-text-trans-mode");
|
||||
static const std::string cfg_global_trans ("global-trans");
|
||||
static const std::string cfg_no_stipple ("no-stipple");
|
||||
static const std::string cfg_stipple_offset ("stipple-offset");
|
||||
|
|
|
|||
|
|
@ -123,4 +123,25 @@ TEST(1)
|
|||
EXPECT_EQ (ti.bbox (text, db::DCplxTrans ()).to_string (), "(12,20.6;24,27)");
|
||||
EXPECT_EQ (ti.bbox (text, db::DCplxTrans (2.0)).to_string (), "(11,19.6;23,26)");
|
||||
EXPECT_EQ (ti.bbox (text, db::DCplxTrans (db::DFTrans (1))).to_string (), "(10.6,6;17,18)");
|
||||
|
||||
// apply_text_trans = true, scale only
|
||||
lv.apply_text_trans (true);
|
||||
lv.apply_text_trans_mode (1);
|
||||
ti = lay::TextInfo (&lv);
|
||||
EXPECT_EQ (ti.bbox (text3, db::DCplxTrans ()).to_string (), "(12,15;134,83)");
|
||||
// with apply_text_trans_mode not including rotation, the global transformation does change the text
|
||||
// bounding box.
|
||||
EXPECT_EQ (ti.bbox (text, db::DCplxTrans ()).to_string (), "(12,20.6;24,27)");
|
||||
EXPECT_EQ (ti.bbox (text, db::DCplxTrans (2.0)).to_string (), "(11,19.6;23,26)");
|
||||
EXPECT_EQ (ti.bbox (text, db::DCplxTrans (db::DFTrans (1))).to_string (), "(10.6,6;17,18)");
|
||||
|
||||
// apply_text_trans = true, rotation only
|
||||
lv.apply_text_trans (true);
|
||||
lv.apply_text_trans_mode (2);
|
||||
ti = lay::TextInfo (&lv);
|
||||
EXPECT_EQ (ti.bbox (text3, db::DCplxTrans ()).to_string (), "(-4.2,22;9.4,46.4)");
|
||||
// with apply_text_trans including rotation, the global transformation changes the text bounding box
|
||||
EXPECT_EQ (ti.bbox (text, db::DCplxTrans ()).to_string (), "(12,20.6;24,27)");
|
||||
EXPECT_EQ (ti.bbox (text, db::DCplxTrans (2.0)).to_string (), "(11,19.6;23,26)");
|
||||
EXPECT_EQ (ti.bbox (text, db::DCplxTrans (db::DFTrans (1))).to_string (), "(12,20.6;24,27)");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
<ui version="4.0" >
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>LayoutViewConfigPage2b</class>
|
||||
<widget class="QFrame" name="LayoutViewConfigPage2b" >
|
||||
<property name="geometry" >
|
||||
<widget class="QFrame" name="LayoutViewConfigPage2b">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
|
|
@ -9,57 +10,55 @@
|
|||
<height>276</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle" >
|
||||
<property name="windowTitle">
|
||||
<string>Settings</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" >
|
||||
<property name="margin" >
|
||||
<layout class="QGridLayout">
|
||||
<property name="margin" stdset="0">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="0" column="0" >
|
||||
<widget class="QGroupBox" name="text_group" >
|
||||
<property name="title" >
|
||||
<item row="0" column="0">
|
||||
<widget class="QGroupBox" name="text_group">
|
||||
<property name="title">
|
||||
<string>Show texts or properties</string>
|
||||
</property>
|
||||
<property name="checkable" >
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<layout class="QGridLayout" >
|
||||
<property name="margin" >
|
||||
<layout class="QGridLayout">
|
||||
<property name="margin" stdset="0">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="2" column="1" >
|
||||
<widget class="QFrame" name="frame_3" >
|
||||
<property name="frameShape" >
|
||||
<item row="2" column="1">
|
||||
<widget class="QFrame" name="frame_3">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow" >
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<layout class="QHBoxLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="margin" stdset="0">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="text_def_size_edit" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy>
|
||||
<hsizetype>0</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<widget class="QLineEdit" name="text_def_size_edit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize" >
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
|
|
@ -68,26 +67,24 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="textLabel2_2_2" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy>
|
||||
<hsizetype>0</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<widget class="QLabel" name="textLabel2_2_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<property name="text">
|
||||
<string>micron</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
|
|
@ -98,34 +95,34 @@
|
|||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" >
|
||||
<widget class="QFrame" name="frame_2" >
|
||||
<property name="frameShape" >
|
||||
<item row="1" column="1">
|
||||
<widget class="QFrame" name="frame_2">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow" >
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<layout class="QHBoxLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="margin" stdset="0">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="lay::ColorButton" name="text_color_pb" >
|
||||
<property name="text" >
|
||||
<widget class="lay::ColorButton" name="text_color_pb">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
|
|
@ -136,30 +133,30 @@
|
|||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" >
|
||||
<widget class="QFrame" name="frame" >
|
||||
<property name="frameShape" >
|
||||
<item row="0" column="1">
|
||||
<widget class="QFrame" name="frame">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow" >
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<layout class="QHBoxLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="margin" stdset="0">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QComboBox" name="text_font_cb" />
|
||||
<widget class="QComboBox" name="text_font_cb"/>
|
||||
</item>
|
||||
<item>
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
|
|
@ -170,15 +167,15 @@
|
|||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2" >
|
||||
<item row="3" column="0" colspan="2">
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType" >
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>561</width>
|
||||
<height>16</height>
|
||||
|
|
@ -186,47 +183,54 @@
|
|||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="2" >
|
||||
<widget class="QCheckBox" name="text_apply_trans_cbx" >
|
||||
<property name="text" >
|
||||
<string>Apply text scaling and rotation (not available for "Default" font)</string>
|
||||
<item row="4" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="text_apply_trans_scale_cbx">
|
||||
<property name="text">
|
||||
<string>Apply text scaling (not available for "Default" font)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0" colspan="2" >
|
||||
<widget class="QCheckBox" name="show_properties_cbx" >
|
||||
<property name="text" >
|
||||
<item row="6" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="show_properties_cbx">
|
||||
<property name="text">
|
||||
<string>Show properties also</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" >
|
||||
<widget class="QLabel" name="textLabel3_3" >
|
||||
<property name="text" >
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="textLabel3_3">
|
||||
<property name="text">
|
||||
<string>Color</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" >
|
||||
<widget class="QLabel" name="textLabel1_2_2_2" >
|
||||
<property name="text" >
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="textLabel1_2_2_2">
|
||||
<property name="text">
|
||||
<string>Standard text size</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" >
|
||||
<widget class="QLabel" name="textLabel1_3_2" >
|
||||
<property name="text" >
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="textLabel1_3_2">
|
||||
<property name="text">
|
||||
<string>Text font</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="text_apply_trans_rotate_cbx">
|
||||
<property name="text">
|
||||
<string>Apply text rotation (not available for "Default" font)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11" />
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>lay::ColorButton</class>
|
||||
|
|
@ -237,9 +241,10 @@
|
|||
<tabstops>
|
||||
<tabstop>text_group</tabstop>
|
||||
<tabstop>text_font_cb</tabstop>
|
||||
<tabstop>text_apply_trans_cbx</tabstop>
|
||||
<tabstop>text_def_size_edit</tabstop>
|
||||
<tabstop>text_color_pb</tabstop>
|
||||
<tabstop>text_def_size_edit</tabstop>
|
||||
<tabstop>text_apply_trans_scale_cbx</tabstop>
|
||||
<tabstop>text_apply_trans_rotate_cbx</tabstop>
|
||||
<tabstop>show_properties_cbx</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
|
|
|
|||
|
|
@ -300,7 +300,15 @@ LayoutViewConfigPage2b::setup (lay::Dispatcher *root)
|
|||
|
||||
bool flag = false;
|
||||
root->config_get (cfg_apply_text_trans, flag);
|
||||
mp_ui->text_apply_trans_cbx->setChecked (flag);
|
||||
|
||||
unsigned int mode = 0;
|
||||
if (flag) {
|
||||
mode = 3;
|
||||
root->config_get (cfg_apply_text_trans_mode, mode);
|
||||
}
|
||||
|
||||
mp_ui->text_apply_trans_scale_cbx->setChecked ((mode & 1) != 0);
|
||||
mp_ui->text_apply_trans_rotate_cbx->setChecked ((mode & 2) != 0);
|
||||
|
||||
root->config_get (cfg_text_visible, flag);
|
||||
mp_ui->text_group->setChecked (flag);
|
||||
|
|
@ -327,8 +335,11 @@ LayoutViewConfigPage2b::setup (lay::Dispatcher *root)
|
|||
void
|
||||
LayoutViewConfigPage2b::commit (lay::Dispatcher *root)
|
||||
{
|
||||
unsigned int mode = (mp_ui->text_apply_trans_scale_cbx->isChecked () ? 1 : 0) | (mp_ui->text_apply_trans_rotate_cbx->isChecked () ? 2 : 0);
|
||||
root->config_set (cfg_apply_text_trans, mode != 0); // for backward compatibility before version 0.30.8
|
||||
root->config_set (cfg_apply_text_trans_mode, mode);
|
||||
|
||||
root->config_set (cfg_text_color, mp_ui->text_color_pb->get_color (), ColorConverter ());
|
||||
root->config_set (cfg_apply_text_trans, mp_ui->text_apply_trans_cbx->isChecked ());
|
||||
root->config_set (cfg_text_visible, mp_ui->text_group->isChecked ());
|
||||
root->config_set (cfg_show_properties, mp_ui->show_properties_cbx->isChecked ());
|
||||
root->config_set (cfg_text_font, mp_ui->text_font_cb->currentIndex ());
|
||||
|
|
|
|||
Loading…
Reference in New Issue