Skip to content

Commit

Permalink
Merge pull request #51 from darkxex/master
Browse files Browse the repository at this point in the history
More Bug Fixed
  • Loading branch information
darkxex authored Feb 19, 2022
2 parents b3e29ff + 4ebf6f7 commit 96e0286
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 8 deletions.
1 change: 1 addition & 0 deletions include/gui.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ extern SysIcons nxmpicons;
extern int newResW;
extern int newResH;
extern float multiplyRes;
extern int initSize;
extern float initScale;
extern bool isHandheld;
extern bool clockoc;
Expand Down
1 change: 1 addition & 0 deletions include/libmpv.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ struct decoderlist_struct{
extern Config *configini;
extern bool clockoc;
extern float initScale;
extern int initSize;

class libMpv{
public:
Expand Down
1 change: 1 addition & 0 deletions include/playerwindows.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ extern int newResH;
extern float multiplyRes;
extern bool isHandheld;
extern float initScale;
extern int initSize;
namespace playerWindows{

inline void SetupCacheWindow(void){
Expand Down
14 changes: 7 additions & 7 deletions source/UI/playerWindows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ namespace playerWindows{

static int drag_subpos = 100;
static float drag_subdelay = 0.0f;
static int drag_subfontsize = 55;
static int drag_subfontbordersize = 3;
static float drag_subborderblur = 0.0f;
static int drag_shadowposition = 1;
Expand Down Expand Up @@ -594,7 +593,7 @@ namespace playerWindows{
if(ImGui::Button("Reset to Default",ImVec2(190, 30))){
drag_subpos = 100;
drag_subdelay = 0.0f;
drag_subfontsize = configini->getSubFontSize(false);
initSize = configini->getSubFontSize(false);
drag_subfontbordersize = 3;
drag_shadowposition = 1;
drag_shadowintensity = 0.25f;
Expand All @@ -610,7 +609,7 @@ namespace playerWindows{
libmpv->setSubBorderBlur(drag_subborderblur,false);
libmpv->setSubPos(drag_subpos,false);
libmpv->setSubDelay(drag_subdelay,false);
libmpv->setSubFontSize(drag_subfontsize,false);
libmpv->setSubFontSize(initSize,false);
configini->setSubFontColor(configini->getSubFontColor(false));
libmpv->setSubFontColor(configini->getSubFontColorHex(true));
//bordercolor
Expand Down Expand Up @@ -662,15 +661,16 @@ namespace playerWindows{
//ImGui::BeginDisabled();
ImGui::SetCursorPosX((windowWidth - ImGui::CalcTextSize("Sub Font Size", NULL, true).x) * 0.5f);
ImGui::Text("Sub Font Size");
if(ImGui::DragInt("Sub Font Size", &drag_subfontsize, 0.5f, 1, 120, "%d", ImGuiSliderFlags_NoInput)){
libmpv->setSubFontSize(drag_subfontsize,item.playershowcontrols);
if(ImGui::DragInt("Sub Font Size", &initSize, 0.5f, 1, 120, "%d", ImGuiSliderFlags_NoInput)){
configini->setSubFontSize(initSize);
libmpv->setSubFontSize(initSize,item.playershowcontrols);
}
//fontscale
ImGui::SetCursorPosX((windowWidth - ImGui::CalcTextSize("Sub Font Scale", NULL, true).x) * 0.5f);
ImGui::Text("Sub Font Scale");
if(ImGui::DragFloat("Sub Font Scale", &initScale, 0.01f, 0.0f, 3.0f, "%.2f", ImGuiSliderFlags_NoInput)){
configini->setSubFontScale(initScale);
libmpv->setSubScaleSize(initScale,item.playershowcontrols);
configini->setSubFontScale(initScale);
libmpv->setSubScaleSize(initScale,item.playershowcontrols);
}
//fontscale
//bordersize
Expand Down
24 changes: 23 additions & 1 deletion source/UI/settingsMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,35 @@ namespace Windows {
}
ImGui::SameLine(0.0f, spacing);
if (ImGui::ArrowButton("##subsizeright", ImGuiDir_Right)) {
if(configini->getSubFontSize(true)+1 <120){
if(configini->getSubFontSize(true)+1 <=120){
configini->setSubFontSize(configini->getSubFontSize(true)+1);
}
}
ImGui::PopButtonRepeat();
ImGui::SameLine();
ImGui::Text("%d", configini->getSubFontSize(true));
ImGui::Dummy(ImVec2(0.0f,10.0f));

//SubFontScale
ImGui::Text("Sub Font Scale");
ImGui::SameLine(220,spacing);
ImGui::PushButtonRepeat(true);
if (ImGui::ArrowButton("##subsizescaleleft", ImGuiDir_Left)) {
if(configini->getSubFontScale(true)-0.01f >0.0f){
configini->setSubFontScale(configini->getSubFontScale(true)-0.01f);
}
}
ImGui::SameLine(0.0f, spacing);
if (ImGui::ArrowButton("##subsizescaleright", ImGuiDir_Right)) {
if(configini->getSubFontScale(true)+0.01f <=3.0f){
configini->setSubFontScale(configini->getSubFontScale(true)+0.01f);
}
}
ImGui::PopButtonRepeat();
ImGui::SameLine();
ImGui::Text("%.2f", configini->getSubFontScale(true));
ImGui::Dummy(ImVec2(0.0f,30.0f));
//endSubFontScale
ImGui::Text("Video");
ImGui::Separator();
std::vector<std::string> deintmenu = {"No","Yes","Auto"};
Expand Down Expand Up @@ -403,6 +424,7 @@ namespace Windows {
configini->setThemeName(configini->getThemeName(false));

configini->setSubFontSize(configini->getSubFontSize(false));
configini->setSubFontScale(configini->getSubFontScale(false));
configini->setSubFontColor(configini->getSubFontColor(false));
//bordercolor
configini->setSubBorderColor(configini->getSubBorderColor(false));
Expand Down
1 change: 1 addition & 0 deletions source/libmpv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ void libMpv::loadFile(std::string _path){
const char *cmd[] = {"loadfile", _path.c_str(), NULL};
mpv_command_async(handle, 0, cmd);
setLoop(false);
initSize = configini->getSubFontSize(false);
setSubFontSize(configini->getSubFontSize(false),false);
initScale = configini->getSubFontScale(false);
setSubScaleSize(configini->getSubFontScale(false),false);
Expand Down
1 change: 1 addition & 0 deletions source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ int newResW = 1280;
int newResH = 720;
float multiplyRes = 1.0f;
float initScale = 1.0f;
int initSize = 55;
std::string tempKbUrl = "";
shaderMania* shadermania = nullptr;

Expand Down

0 comments on commit 96e0286

Please sign in to comment.