diff --git a/src/edt/edt/edtService.cc b/src/edt/edt/edtService.cc index f8201c964..f5a11c505 100644 --- a/src/edt/edt/edtService.cc +++ b/src/edt/edt/edtService.cc @@ -1192,8 +1192,11 @@ Service::transient_select (const db::DPoint &pos) marker->set_vertex_shape (lay::ViewOp::Cross); marker->set_vertex_size (9 /*cross vertex size*/); marker->set (inst, gt, tv); - marker->set_line_width (1); - marker->set_halo (0); + marker->set_line_width (view ()->default_transient_marker_line_width ()); + marker->set_halo (view ()->default_transient_marker_halo ()); + marker->set_color (view ()->default_transient_marker_color ()); + marker->set_dither_pattern (view ()->default_transient_dither_pattern ()); + marker->set_line_style (view ()->default_transient_line_style ()); marker->set_text_enabled (false); mp_transient_marker = marker; @@ -1205,9 +1208,12 @@ Service::transient_select (const db::DPoint &pos) lay::Marker *marker = new lay::Marker (view (), r->cv_index ()); db::box_convert bc (cv->layout ()); marker->set (bc (r->back ().inst_ptr.cell_inst ().object ()), gt * r->back ().inst_ptr.cell_inst ().complex_trans (*r->back ().array_inst), tv); - marker->set_vertex_size (0); - marker->set_line_width (1); - marker->set_halo (0); + marker->set_vertex_size (view ()->default_transient_marker_vertex_size ()); + marker->set_line_width (view ()->default_transient_marker_line_width ()); + marker->set_halo (view ()->default_transient_marker_halo ()); + marker->set_color (view ()->default_transient_marker_color ()); + marker->set_dither_pattern (view ()->default_transient_dither_pattern ()); + marker->set_line_style (view ()->default_transient_line_style ()); mp_transient_marker = marker; @@ -1258,10 +1264,13 @@ Service::transient_select (const db::DPoint &pos) marker->set_vertex_shape (lay::ViewOp::Cross); marker->set_vertex_size (9 /*cross vertex size*/); } else { - marker->set_vertex_size (0); + marker->set_vertex_size (view ()->default_transient_marker_vertex_size ()); } - marker->set_line_width (1); - marker->set_halo (0); + marker->set_line_width (view ()->default_transient_marker_line_width ()); + marker->set_halo (view ()->default_transient_marker_halo ()); + marker->set_color (view ()->default_transient_marker_color ()); + marker->set_dither_pattern (view ()->default_transient_dither_pattern ()); + marker->set_line_style (view ()->default_transient_line_style ()); mp_transient_marker = marker; diff --git a/src/laybasic/laybasic/layLayoutViewBase.cc b/src/laybasic/laybasic/layLayoutViewBase.cc index a5341edb2..aab012789 100644 --- a/src/laybasic/laybasic/layLayoutViewBase.cc +++ b/src/laybasic/laybasic/layLayoutViewBase.cc @@ -376,6 +376,11 @@ LayoutViewBase::init (db::Manager *mgr) m_marker_dither_pattern = 1; m_marker_line_style = 0; m_marker_halo = true; + m_transient_marker_line_width = 0; + m_transient_marker_vertex_size = 0; + m_transient_marker_dither_pattern = 1; + m_transient_marker_line_style = 0; + m_transient_marker_halo = true; m_transient_selection_mode = true; m_sel_inside_pcells = false; m_add_other_layers = false; @@ -1301,6 +1306,84 @@ LayoutViewBase::configure (const std::string &name, const std::string &value) // do not take - let others receive this configuration as well return false; + } else if (name == cfg_transient_sel_color) { + + tl::Color color; + lay::ColorConverter ().from_string (value, color); + + // Change the color + if (lay::test_and_set (m_transient_marker_color, color)) { + mp_canvas->update_image (); + } + + // do not take - let others receive this configuration as well + return false; + + } else if (name == cfg_transient_sel_line_width) { + + int lw = 0; + tl::from_string (value, lw); + + // Change the line width + if (lay::test_and_set (m_transient_marker_line_width, lw)) { + mp_canvas->update_image (); + } + + // do not take - let others receive this configuration as well + return false; + + } else if (name == cfg_transient_sel_dither_pattern) { + + int dp = 0; + tl::from_string (value, dp); + + // Change the vertex_size + if (lay::test_and_set (m_transient_marker_dither_pattern, dp)) { + mp_canvas->update_image (); + } + + // do not take - let others receive this configuration as well + return false; + + } else if (name == cfg_transient_sel_line_style) { + + int dp = 0; + tl::from_string (value, dp); + + // Change the vertex_size + if (lay::test_and_set (m_transient_marker_line_style, dp)) { + mp_canvas->update_image (); + } + + // do not take - let others receive this configuration as well + return false; + + } else if (name == cfg_transient_sel_vertex_size) { + + int vs = 0; + tl::from_string (value, vs); + + // Change the vertex_size + if (lay::test_and_set (m_transient_marker_vertex_size, vs)) { + mp_canvas->update_image (); + } + + // do not take - let others receive this configuration as well + return false; + + } else if (name == cfg_transient_sel_halo) { + + bool halo = 0; + tl::from_string (value, halo); + + // Change the vertex_size + if (lay::test_and_set (m_transient_marker_halo, halo)) { + mp_canvas->update_image (); + } + + // do not take - let others receive this configuration as well + return false; + } else { return false; } diff --git a/src/laybasic/laybasic/layLayoutViewBase.h b/src/laybasic/laybasic/layLayoutViewBase.h index 2682e8477..5b85c33e0 100644 --- a/src/laybasic/laybasic/layLayoutViewBase.h +++ b/src/laybasic/laybasic/layLayoutViewBase.h @@ -2347,6 +2347,55 @@ class LAYBASIC_PUBLIC LayoutViewBase : return m_marker_halo; } + + /** + * @brief Get the default color for markers + */ + tl::Color default_transient_marker_color () const + { + return m_transient_marker_color; + } + + /** + * @brief Get the default line width for markers + */ + int default_transient_marker_line_width () const + { + return m_transient_marker_line_width; + } + + /** + * @brief Get the default marker dither pattern index + */ + int default_transient_dither_pattern () const + { + return m_transient_marker_dither_pattern; + } + + /** + * @brief Get the default marker line style index + */ + int default_transient_line_style () const + { + return m_transient_marker_line_style; + } + + /** + * @brief Get the default vertex size for markers + */ + int default_transient_marker_vertex_size () const + { + return m_transient_marker_vertex_size; + } + + /** + * @brief Get the default halo flag for markers + */ + int default_transient_marker_halo () const + { + return m_transient_marker_halo; + } + /** * @brief Gets the "search range" in pixels (for single click) * The search range applies whenever some object is looked up in the vicinity of the @@ -2845,6 +2894,13 @@ class LAYBASIC_PUBLIC LayoutViewBase : int m_marker_line_style; bool m_marker_halo; + tl::Color m_transient_marker_color; + int m_transient_marker_line_width; + int m_transient_marker_vertex_size; + int m_transient_marker_dither_pattern; + int m_transient_marker_line_style; + bool m_transient_marker_halo; + unsigned int m_search_range; unsigned int m_search_range_box; diff --git a/src/laybasic/laybasic/layLayoutViewConfig.cc b/src/laybasic/laybasic/layLayoutViewConfig.cc index 4d879a024..2df06a503 100644 --- a/src/laybasic/laybasic/layLayoutViewConfig.cc +++ b/src/laybasic/laybasic/layLayoutViewConfig.cc @@ -75,6 +75,12 @@ class LayoutViewBasicConfigDeclaration options.push_back (std::pair (cfg_sel_dither_pattern, "1")); options.push_back (std::pair (cfg_sel_line_style, "0")); options.push_back (std::pair (cfg_sel_halo, "true")); + options.push_back (std::pair (cfg_transient_sel_color, cc.to_string (tl::Color ()))); + options.push_back (std::pair (cfg_transient_sel_line_width, "1")); + options.push_back (std::pair (cfg_transient_sel_vertex_size, "0")); + options.push_back (std::pair (cfg_transient_sel_dither_pattern, "-1")); // no specific one + options.push_back (std::pair (cfg_transient_sel_line_style, "-1")); // no specific one + options.push_back (std::pair (cfg_transient_sel_halo, "false")); options.push_back (std::pair (cfg_sel_transient_mode, "true")); options.push_back (std::pair (cfg_sel_inside_pcells_mode, "false")); options.push_back (std::pair (cfg_tracking_cursor_enabled, "true")); diff --git a/src/laybasic/laybasic/laybasicConfig.h b/src/laybasic/laybasic/laybasicConfig.h index a9b654c2d..2aeedd71d 100644 --- a/src/laybasic/laybasic/laybasicConfig.h +++ b/src/laybasic/laybasic/laybasicConfig.h @@ -72,6 +72,12 @@ static const std::string cfg_sel_vertex_size ("sel-vertex-size"); static const std::string cfg_sel_halo ("sel-halo"); static const std::string cfg_sel_dither_pattern ("sel-dither-pattern"); static const std::string cfg_sel_line_style ("sel-line-style"); +static const std::string cfg_transient_sel_color ("transient-sel-color"); +static const std::string cfg_transient_sel_line_width ("transient-sel-line-width"); +static const std::string cfg_transient_sel_vertex_size ("transient-sel-vertex-size"); +static const std::string cfg_transient_sel_halo ("transient-sel-halo"); +static const std::string cfg_transient_sel_dither_pattern ("transient-sel-dither-pattern"); +static const std::string cfg_transient_sel_line_style ("transient-sel-line-style"); static const std::string cfg_sel_transient_mode ("sel-transient-mode"); static const std::string cfg_sel_inside_pcells_mode ("sel-inside-pcells-mode"); diff --git a/src/layui/layui/LayoutViewConfigPage2c.ui b/src/layui/layui/LayoutViewConfigPage2c.ui index ffadaf23e..5837415c1 100644 --- a/src/layui/layui/LayoutViewConfigPage2c.ui +++ b/src/layui/layui/LayoutViewConfigPage2c.ui @@ -6,8 +6,8 @@ 0 0 - 608 - 318 + 648 + 497 @@ -50,13 +50,37 @@ 6 - - + + + + Vertex size + + + + + + + Marker fill + + + + + + + The color in which the rulers are drawn + + + + + Line width + + + @@ -64,19 +88,32 @@ - + + + + Qt::Horizontal + + QSizePolicy::Fixed + - 71 + 41 31 + + + + + + + @@ -90,70 +127,47 @@ - - + + - - + + - Line width + Marker color - + Qt::Horizontal - - QSizePolicy::Fixed - - 41 + 71 31 - - - - Vertex size - - - - - - - - - - The color in which the rulers are drawn - + + - + With halo - - + + - Marker color + Marker line style - - + + - Marker fill - - - - - - - With halo + @@ -177,10 +191,139 @@ - - + + Transient mode (tracking of selectable objects under the mouse) + + true + + + false + + + + + + Marker color + + + + + + + The color in which the rulers are drawn + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 41 + 31 + + + + + + + + Line width + + + + + + + + + + + 0 + 0 + + + + pixel + + + + + + + Qt::Horizontal + + + + 241 + 31 + + + + + + + + Marker fill + + + + + + + + + + + + + + Vertex size + + + + + + + + + + pixel + + + + + + + With halo + + + + + + + + + + + + + + Marker line style + + + + @@ -319,13 +462,16 @@ QPushButton
layWidgets.h
+ + lay::LineStyleSelectionButton + QPushButton +
layWidgets.h
+
color_pb lw_spinbx - halo_cb vs_spinbx - transient_mode_cb diff --git a/src/layui/layui/layLayoutViewConfigPages.cc b/src/layui/layui/layLayoutViewConfigPages.cc index 761144037..4caff20b7 100644 --- a/src/layui/layui/layLayoutViewConfigPages.cc +++ b/src/layui/layui/layLayoutViewConfigPages.cc @@ -361,13 +361,41 @@ LayoutViewConfigPage2c::setup (lay::Dispatcher *root) root->config_get (cfg_sel_dither_pattern, dp); mp_ui->stipple_pb->set_dither_pattern (dp); + int ls = 0; + root->config_get (cfg_sel_line_style, ls); + mp_ui->line_style_pb->set_line_style (ls); + bool halo = 0; root->config_get (cfg_sel_halo, halo); mp_ui->halo_cb->setChecked (halo); bool tm = 0; root->config_get (cfg_sel_transient_mode, tm); - mp_ui->transient_mode_cb->setChecked (tm); + mp_ui->transient_mode_gb->setChecked (tm); + + QColor transient_color; + root->config_get (cfg_transient_sel_color, transient_color, lay::ColorConverter ()); + mp_ui->transient_color_pb->set_color (transient_color); + + int transient_lw = 0; + root->config_get (cfg_transient_sel_line_width, transient_lw); + mp_ui->transient_lw_spinbx->setValue (transient_lw); + + int transient_vs = 0; + root->config_get (cfg_transient_sel_vertex_size, transient_vs); + mp_ui->transient_vs_spinbx->setValue (transient_vs); + + int transient_dp = 0; + root->config_get (cfg_transient_sel_dither_pattern, transient_dp); + mp_ui->transient_stipple_pb->set_dither_pattern (transient_dp); + + int transient_ls = 0; + root->config_get (cfg_transient_sel_line_style, transient_ls); + mp_ui->transient_line_style_pb->set_line_style (transient_ls); + + bool transient_halo = 0; + root->config_get (cfg_transient_sel_halo, transient_halo); + mp_ui->transient_halo_cb->setChecked (transient_halo); bool ipm = 0; root->config_get (cfg_sel_inside_pcells_mode, ipm); @@ -393,9 +421,16 @@ LayoutViewConfigPage2c::commit (lay::Dispatcher *root) root->config_set (cfg_sel_color, mp_ui->color_pb->get_color (), cc); root->config_set (cfg_sel_line_width, mp_ui->lw_spinbx->value ()); root->config_set (cfg_sel_vertex_size, mp_ui->vs_spinbx->value ()); + root->config_set (cfg_sel_line_style, mp_ui->line_style_pb->line_style ()); root->config_set (cfg_sel_dither_pattern, mp_ui->stipple_pb->dither_pattern ()); root->config_set (cfg_sel_halo, mp_ui->halo_cb->isChecked ()); - root->config_set (cfg_sel_transient_mode, mp_ui->transient_mode_cb->isChecked ()); + root->config_set (cfg_transient_sel_color, mp_ui->transient_color_pb->get_color (), cc); + root->config_set (cfg_transient_sel_line_width, mp_ui->transient_lw_spinbx->value ()); + root->config_set (cfg_transient_sel_vertex_size, mp_ui->transient_vs_spinbx->value ()); + root->config_set (cfg_transient_sel_dither_pattern, mp_ui->transient_stipple_pb->dither_pattern ()); + root->config_set (cfg_transient_sel_line_style, mp_ui->transient_line_style_pb->line_style ()); + root->config_set (cfg_transient_sel_halo, mp_ui->transient_halo_cb->isChecked ()); + root->config_set (cfg_sel_transient_mode, mp_ui->transient_mode_gb->isChecked ()); root->config_set (cfg_sel_inside_pcells_mode, mp_ui->sel_inside_pcells_cb->isChecked ()); root->config_set (cfg_text_point_mode, mp_ui->text_point_mode_cb->isChecked ()); root->config_set (cfg_search_range, (unsigned int) mp_ui->search_range_spinbx->value ());