Skip to content

Commit

Permalink
imp symbol: rename preview to text placement
Browse files Browse the repository at this point in the history
changelog: Enhancements/Symbol Editor: rename preview to text placement
  • Loading branch information
carrotIndustries committed Jul 2, 2022
1 parent e3e998f commit 8279060
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/imp/action_catalog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1076,6 +1076,10 @@ const std::map<ActionToolID, ActionCatalogItem> action_catalog = {
{{ActionID::TOOL, ToolID::MOVE_TRACK_CENTER},
{"Move track arc center", ActionGroup::MOVE, ActionCatalogItem::AVAILABLE_IN_BOARD,
ActionCatalogItem::FLAGS_DEFAULT}},

{{ActionID::SYMBOL_TEXT_PLACEMENT, ToolID::NONE},
{"Edit text placement", ActionGroup::SYMBOL, ActionCatalogItem::AVAILABLE_IN_SYMBOL,
ActionCatalogItem::FLAGS_DEFAULT}},
};

const std::vector<std::pair<ActionGroup, std::string>> action_group_catalog = {
Expand Down Expand Up @@ -1227,6 +1231,7 @@ const LutEnumStr<ActionID> action_lut = {
ACTION_LUT_ITEM(TOGGLE_PICTURES),
ACTION_LUT_ITEM(VIEW_ACTUAL_SIZE),
ACTION_LUT_ITEM(OPEN_DATASHEET),
ACTION_LUT_ITEM(SYMBOL_TEXT_PLACEMENT),
};

#define TOOL_LUT_ITEM(x) \
Expand Down
1 change: 1 addition & 0 deletions src/imp/actions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,6 @@ enum class ActionID {
TOGGLE_PICTURES,
VIEW_ACTUAL_SIZE,
OPEN_DATASHEET,
SYMBOL_TEXT_PLACEMENT,
};
}
6 changes: 4 additions & 2 deletions src/imp/imp_symbol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,13 @@ void ImpSymbol::construct()
symbol_preview_expand_window = new SymbolPreviewExpandWindow(main_window, core_symbol.get_symbol());
core->signal_rebuilt().connect([this] { symbol_preview_expand_window->update(); });


connect_action(ActionID::SYMBOL_TEXT_PLACEMENT, [this](const auto &conn) { symbol_preview_window->present(); });
{
auto button = Gtk::manage(new Gtk::Button("Preview"));
auto button = Gtk::manage(new Gtk::Button("Text placement"));
main_window->header->pack_start(*button);
button->show();
button->signal_clicked().connect([this] { symbol_preview_window->present(); });
button->signal_clicked().connect([this] { trigger_action(ActionID::SYMBOL_TEXT_PLACEMENT); });
}

unplaced_box = Gtk::manage(new UnplacedBox("Pin"));
Expand Down
2 changes: 1 addition & 1 deletion src/imp/symbol_preview/symbol_preview_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ SymbolPreviewWindow::SymbolPreviewWindow(Gtk::Window *parent) : Gtk::Window(), s
set_type_hint(Gdk::WINDOW_TYPE_HINT_DIALOG);
auto hb = Gtk::manage(new Gtk::HeaderBar());
hb->set_show_close_button(true);
hb->set_title("Symbol preview");
hb->set_title("Text placement preview");

auto fit_button = Gtk::manage(new Gtk::Button("Fit views"));
fit_button->signal_clicked().connect(sigc::mem_fun(*this, &SymbolPreviewWindow::zoom_to_fit));
Expand Down

0 comments on commit 8279060

Please sign in to comment.