[DEV] rename gale context and spacer color size

This commit is contained in:
Edouard DUPIN 2021-04-15 01:44:42 +02:00
parent b6c49a3f6f
commit 866d7035a1
3 changed files with 28 additions and 23 deletions

View File

@ -20,7 +20,7 @@ import org.atriasoft.gale.GaleApplication;
import org.atriasoft.gale.Gale; import org.atriasoft.gale.Gale;
import org.atriasoft.gale.context.ClipboardList; import org.atriasoft.gale.context.ClipboardList;
import org.atriasoft.gale.context.CommandLine; import org.atriasoft.gale.context.CommandLine;
import org.atriasoft.gale.context.Context; import org.atriasoft.gale.context.GaleContext;
import org.atriasoft.gale.key.KeyKeyboard; import org.atriasoft.gale.key.KeyKeyboard;
import org.atriasoft.gale.key.KeySpecial; import org.atriasoft.gale.key.KeySpecial;
import org.atriasoft.gale.key.KeyStatus; import org.atriasoft.gale.key.KeyStatus;
@ -72,6 +72,7 @@ public class EwolContext extends GaleApplication {
* Redraw all the windows * Redraw all the windows
*/ */
public void forceRedrawAll() { public void forceRedrawAll() {
Log.warning("force redraw on windows:" + this.windowsCurrent);
if (this.windowsCurrent == null) { if (this.windowsCurrent == null) {
return; return;
} }
@ -147,7 +148,7 @@ public class EwolContext extends GaleApplication {
} }
@Override @Override
public void onCreate(final Context context) { public void onCreate(final GaleContext context) {
Log.info(" == > Ewol system create (BEGIN)"); Log.info(" == > Ewol system create (BEGIN)");
// Add basic ewol translation: // Add basic ewol translation:
ETranslate.addPath("ewol", new Uri("TRANSLATE", "", "ewol")); ETranslate.addPath("ewol", new Uri("TRANSLATE", "", "ewol"));
@ -188,7 +189,7 @@ public class EwolContext extends GaleApplication {
} }
@Override @Override
public void onDestroy(final Context context) { public void onDestroy(final GaleContext context) {
Log.info(" == > Ewol system destroy (BEGIN)"); Log.info(" == > Ewol system destroy (BEGIN)");
// Remove current windows // Remove current windows
this.windowsCurrent = null; this.windowsCurrent = null;
@ -210,8 +211,8 @@ public class EwolContext extends GaleApplication {
} }
@Override @Override
public void onDraw(final Context context) { public void onDraw(final GaleContext context) {
// Log.info("DRAW"); //Log.verbose("EWOL DRAW");
// clean internal data... // clean internal data...
this.objectManager.cleanInternalRemoved(); this.objectManager.cleanInternalRemoved();
// real draw... // real draw...
@ -274,7 +275,7 @@ public class EwolContext extends GaleApplication {
} }
@Override @Override
public void onKillDemand(final Context context) { public void onKillDemand(final GaleContext context) {
Log.info(" == > User demand a destroy (BEGIN)"); Log.info(" == > User demand a destroy (BEGIN)");
final EwolApplication appl = this.application; final EwolApplication appl = this.application;
if (appl == null) { if (appl == null) {
@ -286,7 +287,7 @@ public class EwolContext extends GaleApplication {
} }
@Override @Override
public void onPause(final Context context) { public void onPause(final GaleContext context) {
Log.info(" == > Ewol system pause (BEGIN)"); Log.info(" == > Ewol system pause (BEGIN)");
final EwolApplication appl = this.application; final EwolApplication appl = this.application;
if (appl == null) { if (appl == null) {
@ -322,12 +323,12 @@ public class EwolContext extends GaleApplication {
} }
@Override @Override
public void onRegenerateDisplay(final Context context) { public void onRegenerateDisplay(final GaleContext context) {
// Log.info("REGENERATEDISPLAY"); //Log.info("EWOL onRegenerateDisplay /// ");
// check if the user selected a windows // check if the user selected a windows
final Windows window = this.windowsCurrent; final Windows window = this.windowsCurrent;
if (window == null) { if (window == null) {
Log.debug("No windows ..."); Log.error("No windows ...");
return; return;
} }
// Redraw all needed elements // Redraw all needed elements
@ -338,13 +339,19 @@ public class EwolContext extends GaleApplication {
// markDrawingIsNeeded(); // markDrawingIsNeeded();
} }
@Override
public void onResize(final Vector2f size) {
super.onResize(size);
forceRedrawAll();
}
public void onResize(final Vector2i size) { public void onResize(final Vector2i size) {
Log.verbose("Resize: " + size); Log.verbose("Resize: " + size);
forceRedrawAll(); forceRedrawAll();
} }
@Override @Override
public void onResume(final Context context) { public void onResume(final GaleContext context) {
Log.info(" == > Ewol system resume (BEGIN)"); Log.info(" == > Ewol system resume (BEGIN)");
final EwolApplication appl = this.application; final EwolApplication appl = this.application;
if (appl == null) { if (appl == null) {
@ -355,7 +362,7 @@ public class EwolContext extends GaleApplication {
} }
@Override @Override
public void onStart(final Context context) { public void onStart(final GaleContext context) {
Log.info(" == > Ewol system start (BEGIN)"); Log.info(" == > Ewol system start (BEGIN)");
final EwolApplication appl = this.application; final EwolApplication appl = this.application;
if (appl == null) { if (appl == null) {
@ -367,7 +374,7 @@ public class EwolContext extends GaleApplication {
} }
@Override @Override
public void onStop(final Context context) { public void onStop(final GaleContext context) {
Log.info(" == > Ewol system stop (BEGIN)"); Log.info(" == > Ewol system stop (BEGIN)");
final EwolApplication appl = this.application; final EwolApplication appl = this.application;
if (appl == null) { if (appl == null) {
@ -381,7 +388,7 @@ public class EwolContext extends GaleApplication {
* Request a display after call a resize * Request a display after call a resize
*/ */
public void requestUpdateSize() { public void requestUpdateSize() {
final Context context = Gale.getContext(); final GaleContext context = Gale.getContext();
context.requestUpdateSize(); context.requestUpdateSize();
} }

View File

@ -60,16 +60,14 @@ public class Spacer extends Widget {
} }
this.draw.setColor(this.propertyColor); this.draw.setColor(this.propertyColor);
this.draw.setPos(Vector3f.ZERO); this.draw.setPos(Vector3f.ZERO);
this.draw.setPos(new Vector3f(this.size.x() * 0.1f, this.size.y() * 0.1f, 0)); this.draw.rectangleWidth(new Vector3f(this.size.x(), this.size.y(), 0));
this.draw.rectangleWidth(new Vector3f(this.size.x() * 0.8f, this.size.y() * 0.8f, 0)); //this.draw.setPos(new Vector3f(this.size.x() * 0.1f, this.size.y() * 0.1f, 0));
//this.draw.rectangleWidth(new Vector3f(this.size.x() * 0.8f, this.size.y() * 0.8f, 0));
// this.draw.setColor(Color.RED);
// this.draw.setPos(new Vector3f(-1024, -1024, 0));
// this.draw.rectangleWidth(new Vector3f(2048, 2048, 0));
this.draw.flush(); this.draw.flush();
} }
public void setPropertyTextColorBgOn(final Color propertyColor) { public void setPropertyColor(final Color propertyColor) {
if (propertyColor.equals(this.propertyColor)) { if (propertyColor.equals(this.propertyColor)) {
return; return;
} }

View File

@ -532,7 +532,7 @@ public class Widget extends EwolObject {
*/ */
public void onRegenerateDisplay() {} public void onRegenerateDisplay() {}
protected void onUmpdateMinMaxSize() { protected void onUpdateMinMaxSize() {
final Vector2f pixelMin = this.propertyMinSize.getPixel(); final Vector2f pixelMin = this.propertyMinSize.getPixel();
final Vector2f pixelMax = this.propertyMaxSize.getPixel(); final Vector2f pixelMax = this.propertyMaxSize.getPixel();
// check minimum maximum compatibility : // check minimum maximum compatibility :
@ -708,7 +708,7 @@ public class Widget extends EwolObject {
return; return;
} }
this.propertyMaxSize = value; this.propertyMaxSize = value;
onUmpdateMinMaxSize(); onUpdateMinMaxSize();
} }
public void setPropertyMinSize(final Dimension value) { public void setPropertyMinSize(final Dimension value) {
@ -716,7 +716,7 @@ public class Widget extends EwolObject {
return; return;
} }
this.propertyMinSize = value; this.propertyMinSize = value;
onUmpdateMinMaxSize(); onUpdateMinMaxSize();
} }
/** /**