Exemplo n.º 1
0
void Cutegram::start(bool forceVisible)
{
    if( p->viewer )
        return;

    p->viewer = new AsemanQuickView( AsemanQuickView::AllExceptLogger );
    p->viewer->engine()->rootContext()->setContextProperty( "Cutegram", this );
    init_theme();


    p->viewer->setSource(QUrl(QStringLiteral("qrc:/qml/Cutegram/main.qml")));
#ifdef Q_OS_WIN
    QtWin::extendFrameIntoClientArea(p->viewer,-1,-1,-1,-1);
#endif

    switch(startupOption())
    {
    case StartupAutomatic:
        if(AsemanApplication::settings()->value("General/lastWindowState",true).toBool())
            p->viewer->show();
        break;

    case StartupVisible:
        p->viewer->show();
        break;

    case StartupHide:
        break;
    }

    if(forceVisible)
        p->viewer->show();

    init_systray();
}
Exemplo n.º 2
0
void Cutegram::setSearchEngine(const QString &se)
{
    if(p->searchEngine == se)
        return;

    p->searchEngine = se;
    AsemanApplication::settings()->setValue("General/searchEngine",p->searchEngine);
    init_theme();

    emit searchEngineChanged();
}
Exemplo n.º 3
0
void Cutegram::setTheme(const QString &theme)
{
    if(p->theme == theme)
        return;

    p->theme = theme;
    AsemanApplication::settings()->setValue("General/theme",p->theme);
    init_theme();

    emit themeChanged();
}
Exemplo n.º 4
0
void Cutegram::start(bool forceVisible)
{
    if( p->viewer )
        return;

    p->viewer = new AsemanQuickView();
    p->viewer->engine()->rootContext()->setContextProperty( "Cutegram", this );
    p->viewer->setColor(QColor(0,0,0,0));
    p->viewer->setFlags(Qt::Window|
                        (nativeTitleBar()?Qt::FramelessWindowHint|Qt::NoDropShadowWindowHint:
                                          Qt::Widget)|
                        Qt::WindowTitleHint|
                        Qt::WindowSystemMenuHint|
                        Qt::WindowMinMaxButtonsHint|
                        Qt::WindowCloseButtonHint|
                        Qt::WindowFullscreenButtonHint);

    init_theme();

    p->viewer->setSource(QUrl(QStringLiteral("qrc:/qml/Cutegram/main.qml")));

    QPoint point = AsemanApplication::settings()->value("General/position").toPoint();
    if(!point.isNull())
        p->viewer->setPosition(point);

#ifdef Q_OS_WIN
    QtWin::extendFrameIntoClientArea(p->viewer,-1,-1,-1,-1);
#endif

    switch(startupOption())
    {
    case StartupAutomatic:
        if(AsemanApplication::settings()->value("General/lastWindowState",true).toBool())
            p->viewer->show();
        break;

    case StartupVisible:
        p->viewer->show();
        break;

    case StartupHide:
        break;
    }

    if(forceVisible)
        p->viewer->show();

    p->viewer->installEventFilter(this);
    init_systray();
}
static void on_sync_theme_with_wm_toggled(GtkToggleButton *sync_wm_theme, WBPlugin *wb)
{
    GtkWidget   *view;

    view = GTK_WIDGET(gtk_builder_get_object(wb->prefs->builder, "theme_name_treeview"));

    wb->prefs->sync_wm_theme = gtk_toggle_button_get_active(sync_wm_theme);

    init_theme (wb);
    wckbuttons_load_themes (view, wb);

    if (!wb->prefs->sync_wm_theme)
    {
        GtkWidget    *entry;

        entry = GTK_WIDGET(gtk_builder_get_object(wb->prefs->builder, "button_layout"));
        gtk_widget_set_sensitive (entry, TRUE);
        gtk_entry_set_text (GTK_ENTRY(entry), wb->prefs->button_layout);
    }
}