This commit is contained in:
2026-04-08 16:39:23 +02:00
parent a5378e32b9
commit 7468a16d63
7 changed files with 43 additions and 0 deletions

View File

@@ -229,6 +229,20 @@ void Rktwebview_qt::processCommand(Command *cmd)
cmd->done = true;
}
break;
case COMMAND_SET_ICON: {
int wv = cmd->args[0].toInt();
QString icon_file = cmd->args[1].toString();
if (_views.contains(wv)) {
WebviewWindow *w = _views[wv];
QIcon icn(icon_file);
w->setWindowIcon(icn);
cmd->result = true;
} else {
cmd->result = false;
}
cmd->done = true;
}
break;
case COMMAND_RUN_JS: {
int wv = cmd->args[0].toInt();
QString js = cmd->args[1].toString();
@@ -777,6 +791,17 @@ result_t Rktwebview_qt::rktWindowSetTitle(rktwebview_t wv, const char *title)
return r ? result_t::oke : result_t::failed;
}
result_t Rktwebview_qt::rktWindowSetIcon(rktwebview_t wv, const char *icon_file)
{
Command c(COMMAND_SET_ICON);
c.args.push_back(wv);
c.args.push_back(icon_file);
postCommand(&c);
while(!c.done) { doEvents(); }
bool r = c.result.toBool();
return r ? result_t::oke : result_t::failed;
}
void Rktwebview_qt::msgBox(rktwebview_t w, const QString &title, const QString &message, const QString &submessage, rkt_messagetype_t type)
{