icon
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user