Scroom 0.14-49-gb7ae7a6d
Loading...
Searching...
No Matches
Scroom::Metadata Namespace Reference

Namespaces

 

Typedefs

using Metadata = std::vector< std::pair< std::string, std::string > >
 

Functions

void showMetaData (GtkWindow *parent, std::string title, Metadata data)
 

Typedef Documentation

◆ Metadata

using Scroom::Metadata::Metadata = typedef std::vector<std::pair<std::string, std::string> >

Function Documentation

◆ showMetaData()

void Scroom::Metadata::showMetaData ( GtkWindow *  parent,
std::string  title,
Metadata  data 
)
69 {
70 for(auto& [key, _]: data)
71 {
72 key = fmt::format("<b>{}:</b>", key);
73 }
74 const auto* windowData = new MetaDataWindowData{std::move(title), std::move(data)}; // NOLINT(cppcoreguidelines-owning-memory)
75
76 // Create properties window
77 auto* window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
78 g_signal_connect(
79 static_cast<gpointer>(window),
80 "destroy",
81 G_CALLBACK(on_metadata_destroyed),
82 const_cast<MetaDataWindowData*>(windowData)
83 ); // NOLINT(cppcoreguidelines-pro-type-const-cast)
84
85 gtk_window_set_title(GTK_WINDOW(window), windowData->title.c_str());
86 auto* grid = gtk_grid_new();
87 gtk_container_add(GTK_CONTAINER(window), grid);
88
89 GtkWidget* previousKey = nullptr;
90 for(const auto& [keyText, valueText]: windowData->data)
91 {
92 GtkWidget* key = addNewKeyToGrid(grid, previousKey, keyText);
93 GtkWidget* value = addNewValueToGrid(grid, valueText, key);
94 addKeyAndValueToSizeGroup(key, value);
95
96 previousKey = key;
97 }
98
99 gtk_window_set_transient_for(GTK_WINDOW(window), parent);
100 gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER_ON_PARENT);
101 gtk_widget_show_all(window);
102 gtk_widget_grab_focus(window);
103 }
uint8_t data
Definition blob-tests.cc:36
const uint8_t value
Definition blob-tests.cc:114

Referenced by anonymous_namespace{tiledbitmappresentation.cc}::TiledBitmapPresentation::showMetadata().

Here is the caller graph for this function: