Add icons and highlight.js to project
This commit includes the addition of a new toolbox icon in both .ico and .png formats, updating the resource file to reference the new icon. In addition, numerous highlight.js files and styles have been integrated into the project, enhancing syntax highlighting capabilities. Existing file references in 'out_embed/all.hpp' have been updated accordingly.
This commit is contained in:
+5
-1
@@ -14,7 +14,11 @@ include_directories(inc)
|
||||
#include_directories(out_embed)
|
||||
file(GLOB_RECURSE SOURCES "src/*.cpp" "inc/*.h")
|
||||
|
||||
add_executable(Toolbox main.cpp ${SOURCES})
|
||||
if(WIN32)
|
||||
set(RESOURCE_FILES toolbox.rc)
|
||||
endif()
|
||||
|
||||
add_executable(Toolbox main.cpp ${SOURCES} ${RESOURCE_FILES})
|
||||
|
||||
target_include_directories(${PROJECT_NAME} PRIVATE "out_embed")
|
||||
target_link_libraries(Toolbox PRIVATE saucer::saucer sol2::sol2 lua)
|
||||
|
||||
@@ -10,7 +10,7 @@ int main(int argc, char** argv)
|
||||
{
|
||||
// Initialisiere die Saucer-Anwendung
|
||||
auto app = saucer::application::acquire({
|
||||
.id = "example",
|
||||
.id = "toolbox",
|
||||
});
|
||||
|
||||
saucer::smartview<saucer::default_serializer, hwnd_module> webview({
|
||||
@@ -51,23 +51,39 @@ int main(int argc, char** argv)
|
||||
// Lade die eingebettete "index.html" aus den Ressourcen
|
||||
auto resources = saucer::embedded::all();
|
||||
|
||||
if (resources.find("card.html") == resources.end()) {
|
||||
if (resources.find("html/card.html") == resources.end()) {
|
||||
std::cerr << "Fehler: 'card.html' wurde nicht gefunden!" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
// Überprüfen, ob die "index.html"-Ressource verfügbar ist
|
||||
auto it = resources.find("index.html");
|
||||
auto it = resources.find("html/index.html");
|
||||
if (it == resources.end())
|
||||
{
|
||||
std::cerr << "Fehler: 'index.html' wurde nicht gefunden!" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
webview.embed(resources); // Bindet alle eingebetteten Ressourcen ein
|
||||
webview.serve("index.html"); // Stellt "index.html" bereit
|
||||
webview.serve("html/index.html"); // Stellt "index.html" bereit
|
||||
|
||||
|
||||
webview.set_context_menu(false);
|
||||
|
||||
|
||||
if (resources.find("ico/toolbox.png")== resources.end())
|
||||
{
|
||||
std::cerr << "Fehler: 'toolbox.png' wurde nicht gefunden!" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Erstellen eines saucer::icon-Objekts aus den eingebetteten Bilddaten
|
||||
saucer::icon window_icon;
|
||||
window_icon = window_icon.from(resources.find("ico/toolbox.png")->second.content).value();
|
||||
|
||||
// Setzen des Fenster-Icons mit dem erstellten saucer::icon-Objekt
|
||||
webview.set_icon(window_icon);
|
||||
webview.set_title("Toolbox");
|
||||
webview.register_scheme("Toolbox");
|
||||
|
||||
// Zeige das Fenster an
|
||||
webview.show();
|
||||
|
||||
|
||||
+1090
-4
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
@@ -0,0 +1 @@
|
||||
IDI_ICON1 ICON "res/ico/toolbox.ico"
|
||||
Reference in New Issue
Block a user