mirror of
https://github.com/Almamu/linux-wallpaperengine.git
synced 2025-09-14 13:56:48 +08:00
Make width and height customizable
This commit is contained in:
parent
6460a4fbd5
commit
0b0609e090
@ -25,6 +25,8 @@ struct option long_options [] = {
|
||||
{"list-properties", no_argument, nullptr, 'l'},
|
||||
{"set-property", required_argument, nullptr, 'o'},
|
||||
{"class", required_argument, nullptr, 'x'},
|
||||
{"width", required_argument, nullptr, 'w'},
|
||||
{"height", required_argument, nullptr, 't'},
|
||||
{nullptr, 0, nullptr, 0}
|
||||
};
|
||||
|
||||
@ -51,6 +53,8 @@ CApplicationContext::CApplicationContext (int argc, char* argv[]) :
|
||||
audioEnabled (true),
|
||||
onlyListProperties (false),
|
||||
window_class (""),
|
||||
window_width(1280),
|
||||
window_height(720)
|
||||
{
|
||||
int c;
|
||||
|
||||
@ -116,6 +120,13 @@ CApplicationContext::CApplicationContext (int argc, char* argv[]) :
|
||||
case 'x':
|
||||
this->window_class = optarg;
|
||||
break;
|
||||
case 'w':
|
||||
this->window_width = atoi(optarg);
|
||||
break;
|
||||
|
||||
case 't':
|
||||
this->window_height = atoi(optarg);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -203,4 +214,6 @@ void CApplicationContext::printHelp (const char* route)
|
||||
sLog.out ("\t--list-properties\t\t\tList all the available properties and their possible values");
|
||||
sLog.out ("\t--set-property <name=value>\tOverrides the default value of the given property");
|
||||
sLog.out ("\t--class <class name>\t\t\tSets X11 window class");
|
||||
sLog.out ("\t--width <width>\t\t\tSets the window width");
|
||||
sLog.out ("\t--height <height>\t\t\tSets the window height");
|
||||
}
|
@ -25,6 +25,8 @@ namespace WallpaperEngine::Application
|
||||
bool onlyListProperties;
|
||||
FREE_IMAGE_FORMAT screenshotFormat;
|
||||
std::string window_class;
|
||||
int window_width;
|
||||
int window_height;
|
||||
|
||||
private:
|
||||
void validatePath ();
|
||||
|
@ -272,4 +272,9 @@ void CWallpaperApplication::show ()
|
||||
void CWallpaperApplication::signal (int signal)
|
||||
{
|
||||
g_KeepRunning = false;
|
||||
}
|
||||
|
||||
const CApplicationContext& CWallpaperApplication::get_context () const
|
||||
{
|
||||
return this->m_context;
|
||||
}
|
@ -22,6 +22,7 @@ namespace WallpaperEngine::Application
|
||||
|
||||
void show ();
|
||||
void signal (int signal);
|
||||
const CApplicationContext& get_context () const;
|
||||
|
||||
private:
|
||||
void setupContainer ();
|
||||
|
@ -12,8 +12,6 @@
|
||||
#include "CRenderContext.h"
|
||||
#include "CVideo.h"
|
||||
|
||||
#define DEFAULT_WINDOW_WIDTH 1280
|
||||
#define DEFAULT_WINDOW_HEIGHT 720
|
||||
|
||||
using namespace WallpaperEngine::Render;
|
||||
|
||||
@ -81,7 +79,7 @@ void CRenderContext::initialize ()
|
||||
void CRenderContext::setupWindow ()
|
||||
{
|
||||
this->m_driver.showWindow ();
|
||||
this->m_driver.resizeWindow ({DEFAULT_WINDOW_WIDTH, DEFAULT_WINDOW_HEIGHT});
|
||||
this->m_driver.resizeWindow ({this->m_app.get_context().window_width, this->m_app.get_context().window_height});
|
||||
}
|
||||
|
||||
void CRenderContext::setupScreens ()
|
||||
|
Loading…
Reference in New Issue
Block a user