Minor task bar fixes
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4691 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
25ffe5946c
commit
953e890837
@ -99,6 +99,7 @@ namespace NxWM
|
|||||||
NXWidgets::CImage *m_backImage; /**< The background image */
|
NXWidgets::CImage *m_backImage; /**< The background image */
|
||||||
IApplication *m_topApp; /**< The top application in the hierarchy */
|
IApplication *m_topApp; /**< The top application in the hierarchy */
|
||||||
TNxArray<struct STaskbarSlot> m_slots; /**< List of application slots in the task bar */
|
TNxArray<struct STaskbarSlot> m_slots; /**< List of application slots in the task bar */
|
||||||
|
bool m_started; /**< True if window manager has been started */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a raw window.
|
* Create a raw window.
|
||||||
|
@ -71,6 +71,7 @@ CTaskbar::CTaskbar(void)
|
|||||||
m_background = (NXWidgets::CNxWindow *)0;
|
m_background = (NXWidgets::CNxWindow *)0;
|
||||||
m_backImage = (NXWidgets::CImage *)0;
|
m_backImage = (NXWidgets::CImage *)0;
|
||||||
m_topApp = (IApplication *)0;
|
m_topApp = (IApplication *)0;
|
||||||
|
m_started = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -225,6 +226,14 @@ bool CTaskbar::initWindowManager(void)
|
|||||||
|
|
||||||
bool CTaskbar::startWindowManager(void)
|
bool CTaskbar::startWindowManager(void)
|
||||||
{
|
{
|
||||||
|
// Have we already been started
|
||||||
|
|
||||||
|
if (!m_started)
|
||||||
|
{
|
||||||
|
// We are now started
|
||||||
|
|
||||||
|
m_started = true;
|
||||||
|
|
||||||
// Draw the taskbar
|
// Draw the taskbar
|
||||||
|
|
||||||
if (!redrawTaskbarWindow())
|
if (!redrawTaskbarWindow())
|
||||||
@ -237,6 +246,9 @@ bool CTaskbar::startWindowManager(void)
|
|||||||
return redrawTopWindow();
|
return redrawTopWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create an application window. Creating a new application in the start
|
* Create an application window. Creating a new application in the start
|
||||||
* window requires three steps:
|
* window requires three steps:
|
||||||
@ -334,18 +346,40 @@ bool CTaskbar::startApplication(IApplication *app, bool minimized)
|
|||||||
slot.image = image;
|
slot.image = image;
|
||||||
m_slots.push_back(slot);
|
m_slots.push_back(slot);
|
||||||
|
|
||||||
// Assume for now that this is not the top application
|
// Start the application (whatever that means).
|
||||||
|
|
||||||
hideApplicationWindow(app);
|
|
||||||
|
|
||||||
// Then start the application (whatever that means)
|
|
||||||
|
|
||||||
if (!app->run())
|
if (!app->run())
|
||||||
{
|
{
|
||||||
stopApplication(app);
|
stopApplication(app);
|
||||||
|
image->disable();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Has the window manager been started? Or were we ask to start
|
||||||
|
// the application minimized?
|
||||||
|
|
||||||
|
if (minimized || !m_started)
|
||||||
|
{
|
||||||
|
// Bring the application up in the minimized state
|
||||||
|
|
||||||
|
hideApplicationWindow(app);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Bring up the application as the new top application
|
||||||
|
|
||||||
|
app->setTopApplication(false);
|
||||||
|
app->setMinimized(false);
|
||||||
|
topApplication(app);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Redraw the task bar with the new icon (if we have been started)
|
||||||
|
|
||||||
|
if (m_started)
|
||||||
|
{
|
||||||
|
redrawTaskbarWindow();
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -359,7 +393,7 @@ bool CTaskbar::startApplication(IApplication *app, bool minimized)
|
|||||||
|
|
||||||
bool CTaskbar::topApplication(IApplication *app)
|
bool CTaskbar::topApplication(IApplication *app)
|
||||||
{
|
{
|
||||||
// Verify that the application is not minimized
|
// Verify that the application is not minimized and is not already the top application
|
||||||
|
|
||||||
if (!app->isMinimized() && !app->isTopApplication())
|
if (!app->isMinimized() && !app->isTopApplication())
|
||||||
{
|
{
|
||||||
@ -396,7 +430,7 @@ bool CTaskbar::maximizeApplication(IApplication *app)
|
|||||||
|
|
||||||
app->setMinimized(false);
|
app->setMinimized(false);
|
||||||
|
|
||||||
// Then bring the appliation to the top of the hieararchy
|
// Then bring the application to the top of the hierarchy
|
||||||
|
|
||||||
return topApplication(app);
|
return topApplication(app);
|
||||||
}
|
}
|
||||||
@ -867,8 +901,6 @@ bool CTaskbar::redrawTaskbarWindow(void)
|
|||||||
|
|
||||||
// Do we add icons left-to-right? Or top-to-bottom?
|
// Do we add icons left-to-right? Or top-to-bottom?
|
||||||
|
|
||||||
bool moveTo(nxgl_coord_t x, nxgl_coord_t y);
|
|
||||||
|
|
||||||
#if defined(CONFIG_NXWM_TASKBAR_TOP) || defined(CONFIG_NXWM_TASKBAR_BOTTOM)
|
#if defined(CONFIG_NXWM_TASKBAR_TOP) || defined(CONFIG_NXWM_TASKBAR_BOTTOM)
|
||||||
// left-to-right ... increment the X display position
|
// left-to-right ... increment the X display position
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user