示例#1
0
void MythThemeBase::Init(void)
{
    MythMainWindow *mainWindow = GetMythMainWindow();
    QRect uiSize = mainWindow->GetUIScreenRect();

    d->background = new MythScreenStack(mainWindow, "background");
    d->background->DisableEffects();

    GetGlobalFontManager()->LoadFonts(GetFontsDir(), "Shared");
    GetGlobalFontManager()->LoadFonts(GetMythUI()->GetThemeDir(), "UI");
    XMLParseBase::LoadBaseTheme();
    d->backgroundscreen = new MythScreenType(d->background, "backgroundscreen");

    if (!XMLParseBase::CopyWindowFromBase("backgroundwindow", 
                                          d->backgroundscreen))
    {
        QString backgroundname = GetMythUI()->qtconfig()->GetSetting("BackgroundPixmap"
);
        backgroundname = GetMythUI()->GetThemeDir() + backgroundname;

        d->backimg = new MythUIImage(backgroundname, d->backgroundscreen,
                                     "backimg");
        d->backimg->SetPosition(mainWindow->NormPoint(QPoint(0, 0)));
        d->backimg->SetSize(uiSize.width(), uiSize.height());
        d->backimg->Load();
    }

    d->background->AddScreen(d->backgroundscreen, false);

    new MythScreenStack(mainWindow, "main stack", true);

    new MythScreenStack(mainWindow, "popup stack");
}
示例#2
0
void MythThemeBase::Reload(void)
{
    MythMainWindow *mainWindow = GetMythMainWindow();
    QRect uiSize = mainWindow->GetUIScreenRect();

    GetGlobalFontMap()->Clear();
    XMLParseBase::ClearGlobalObjectStore();
    GetGlobalFontManager()->ReleaseFonts("UI");
    GetGlobalFontManager()->LoadFonts(GetMythUI()->GetThemeDir(), "UI");
    XMLParseBase::LoadBaseTheme();

    d->background->PopScreen(false, true);

    d->backgroundscreen = new MythScreenType(d->background, "backgroundscreen");

    if (!XMLParseBase::CopyWindowFromBase("backgroundwindow",
                                          d->backgroundscreen))
    {
        QString backgroundname = GetMythUI()->qtconfig()->GetSetting("BackgroundPixmap"
);
        backgroundname = GetMythUI()->GetThemeDir() + backgroundname;

        d->backimg = new MythUIImage(backgroundname, d->backgroundscreen,
                                     "backimg");
        d->backimg->SetPosition(mainWindow->NormPoint(QPoint(0, 0)));
        d->backimg->SetSize(uiSize.width(), uiSize.height());
        d->backimg->Load();
    }

    d->background->AddScreen(d->backgroundscreen, false);
}
示例#3
0
MythThemeBase::~MythThemeBase()
{
    GetGlobalFontMap()->Clear();
    XMLParseBase::ClearGlobalObjectStore();
    GetGlobalFontManager()->ReleaseFonts("UI");
    GetGlobalFontManager()->ReleaseFonts("Shared");
    delete d;
}
示例#4
0
MythThemeBase::~MythThemeBase()
{
    GetGlobalFontManager()->ReleaseFonts("UI");
    GetGlobalFontManager()->ReleaseFonts("Shared");
    delete d;
}