Now hides the input cursor when a widget gets hidden
This commit is contained in:
parent
37f238eef7
commit
adccd6ae3b
|
@ -1,3 +1,6 @@
|
|||
2020-10-05 Markus Gans <guru.mail@muenster.de>
|
||||
* Now hides the input cursor when a widget gets hidden
|
||||
|
||||
2020-10-04 Markus Gans <guru.mail@muenster.de>
|
||||
* Replaces some C-style arrays with std::array
|
||||
* Now you can use the arrow keys to move a window into the visible area
|
||||
|
|
|
@ -82,7 +82,7 @@ CheckList::CheckList (finalcut::FWidget* parent)
|
|||
FDialog::setText (L"Shopping list");
|
||||
const std::size_t nf_offset = ( finalcut::FTerm::isNewFont() ) ? 1 : 0;
|
||||
FDialog::setSize (FSize{28 + nf_offset, 13} );
|
||||
setShadow();
|
||||
setShadow(); // Instead of the transparent window shadow
|
||||
listview.ignorePadding();
|
||||
listview.setGeometry ( FPoint{1 + int(nf_offset), 2}
|
||||
, FSize{getWidth() - nf_offset, getHeight() - 1} );
|
||||
|
|
|
@ -65,7 +65,7 @@ int main (int argc, char* argv[])
|
|||
finalcut::FDialog dgl{&app};
|
||||
dgl.setText ("Data input");
|
||||
dgl.setGeometry (FPoint{4, 2}, FSize{37, 22});
|
||||
dgl.setShadow();
|
||||
dgl.setShadow(); // Instead of the transparent window shadow
|
||||
|
||||
// Create input fields
|
||||
finalcut::FLineEdit name_field {&dgl};
|
||||
|
|
|
@ -167,7 +167,7 @@ int main (int argc, char* argv[])
|
|||
// Create a simple dialog box
|
||||
Mandelbrot mb{&app};
|
||||
mb.setGeometry (FPoint{6, 1}, FSize{70, 23});
|
||||
mb.setShadow();
|
||||
mb.setShadow(); // Instead of the transparent window shadow
|
||||
|
||||
// Set the mandelbrot object as main widget
|
||||
finalcut::FWidget::setMainWidget(&mb);
|
||||
|
|
|
@ -139,8 +139,8 @@ void RotoZoomer::draw()
|
|||
//----------------------------------------------------------------------
|
||||
void RotoZoomer::rotozoomer (double cx, double cy, double r, double a)
|
||||
{
|
||||
const int Cols = int(getClientWidth());
|
||||
const int Lines = int(getClientHeight());
|
||||
const auto Cols = int(getClientWidth());
|
||||
const auto Lines = int(getClientHeight());
|
||||
auto Ax = int(4096.0 * (cx + r * std::cos(a)));
|
||||
auto Ay = int(4096.0 * (cy + r * std::sin(a)));
|
||||
auto Bx = int(4096.0 * (cx + r * std::cos(a + 2.02358)));
|
||||
|
@ -323,7 +323,7 @@ int main (int argc, char* argv[])
|
|||
if ( benchmark )
|
||||
roto.setGeometry (FPoint{1, 1}, FSize{80, 24});
|
||||
|
||||
roto.setShadow();
|
||||
roto.setShadow(); // Instead of the transparent window shadow
|
||||
|
||||
// Set the RotoZoomer object as main widget
|
||||
finalcut::FWidget::setMainWidget(&roto);
|
||||
|
|
|
@ -499,7 +499,7 @@ int main (int argc, char* argv[])
|
|||
// the parent object "app" (FObject destructor).
|
||||
AttribDlg dialog{&app};
|
||||
dialog.setSize (FSize{69, 21});
|
||||
dialog.setShadow();
|
||||
dialog.setShadow(); // Instead of the transparent window shadow
|
||||
|
||||
// Create the attribute demo widget as a child object from the dialog
|
||||
AttribDemo demo(&dialog);
|
||||
|
|
|
@ -1067,7 +1067,7 @@ int main (int argc, char* argv[])
|
|||
MyDialog d{&app};
|
||||
d.setText (title);
|
||||
d.setSize (FSize{56, app.getHeight() - 4});
|
||||
d.setShadow();
|
||||
d.setShadow(); // Instead of the transparent window shadow
|
||||
|
||||
// Set the dialog object d as the main widget of the application.
|
||||
// When you close the main widget, the application will be closed.
|
||||
|
|
|
@ -800,8 +800,9 @@ void FVTerm::removeArea (FTermArea*& area)
|
|||
{
|
||||
// remove the virtual window
|
||||
|
||||
if ( area != nullptr )
|
||||
{
|
||||
if ( area == nullptr )
|
||||
return;
|
||||
|
||||
if ( area->changes != nullptr )
|
||||
{
|
||||
delete[] area->changes;
|
||||
|
@ -817,7 +818,6 @@ void FVTerm::removeArea (FTermArea*& area)
|
|||
delete area;
|
||||
area = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void FVTerm::restoreVTerm (const FRect& box)
|
||||
|
@ -876,7 +876,7 @@ bool FVTerm::updateVTermCursor (const FTermArea* area) const
|
|||
if ( ! area )
|
||||
return false;
|
||||
|
||||
if ( area != active_area )
|
||||
if ( ! isActive(area) )
|
||||
return false;
|
||||
|
||||
if ( ! area->visible )
|
||||
|
|
|
@ -638,7 +638,7 @@ bool FWidget::setCursorPos (const FPoint& pos)
|
|||
|
||||
widget_cursor_position.setPoint(pos);
|
||||
|
||||
if ( ! flags.focus || isWindowWidget() )
|
||||
if ( ! flags.focus || flags.hidden || isWindowWidget() )
|
||||
return false;
|
||||
|
||||
if ( ! FWindow::getWindowWidget(this) )
|
||||
|
@ -999,6 +999,11 @@ void FWidget::hide()
|
|||
{
|
||||
flags.shown = false;
|
||||
|
||||
if ( flags.visible_cursor && FWidget::getFocusWidget() == this )
|
||||
{
|
||||
getPrintArea()->input_cursor_visible = false;
|
||||
}
|
||||
|
||||
if ( ! isDialogWidget()
|
||||
&& FWidget::getFocusWidget() == this
|
||||
&& ! focusPrevChild() )
|
||||
|
|
|
@ -278,8 +278,17 @@ void FWindow::show()
|
|||
//----------------------------------------------------------------------
|
||||
void FWindow::hide()
|
||||
{
|
||||
const auto& virtual_win = getVWin();
|
||||
|
||||
if ( isActive(virtual_win)
|
||||
&& virtual_win->visible
|
||||
&& virtual_win->input_cursor_visible )
|
||||
{
|
||||
hideVTermCursor();
|
||||
}
|
||||
|
||||
if ( isVirtualWindow() )
|
||||
getVWin()->visible = false;
|
||||
virtual_win->visible = false;
|
||||
|
||||
FWidget::hide();
|
||||
const auto& t_geometry = getTermGeometryWithShadow();
|
||||
|
@ -681,7 +690,6 @@ void FWindow::switchToPrevWindow (const FWidget* widget)
|
|||
const bool is_activated = activatePrevWindow();
|
||||
auto active_win = static_cast<FWindow*>(getActiveWindow());
|
||||
|
||||
|
||||
if ( ! is_activated
|
||||
&& getWindowList() && getWindowList()->size() > 1 )
|
||||
{
|
||||
|
|
|
@ -145,7 +145,7 @@ class FSystemImpl : public FSystem
|
|||
{
|
||||
va_list args{};
|
||||
va_start (args, flags);
|
||||
mode_t mode = static_cast<mode_t>(va_arg (args, int));
|
||||
auto mode = static_cast<mode_t>(va_arg (args, int));
|
||||
int ret = ::open (pathname, flags, mode);
|
||||
va_end (args);
|
||||
return ret;
|
||||
|
|
|
@ -292,6 +292,7 @@ class FVTerm
|
|||
void setActiveArea (FTermArea*) const;
|
||||
|
||||
// Inquiries
|
||||
bool isActive (const FTermArea*) const;
|
||||
bool hasPrintArea() const;
|
||||
bool hasChildPrintArea() const;
|
||||
bool isVirtualWindow() const;
|
||||
|
@ -307,6 +308,7 @@ class FVTerm
|
|||
static void removeArea (FTermArea*&);
|
||||
static void restoreVTerm (const FRect&);
|
||||
bool updateVTermCursor (const FTermArea*) const;
|
||||
void hideVTermCursor() const;
|
||||
static void setAreaCursor ( const FPoint&
|
||||
, bool, FTermArea* );
|
||||
static void getArea (const FPoint&, const FTermArea*);
|
||||
|
@ -966,6 +968,10 @@ inline void FVTerm::setChildPrintArea (FTermArea* area)
|
|||
inline void FVTerm::setActiveArea (FTermArea* area) const
|
||||
{ active_area = area; }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline bool FVTerm::isActive (const FTermArea* area) const
|
||||
{ return bool( area == active_area ); }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline bool FVTerm::hasPrintArea() const
|
||||
{ return print_area; }
|
||||
|
@ -982,6 +988,9 @@ inline bool FVTerm::isVirtualWindow() const
|
|||
inline bool FVTerm::isCursorHideable() const
|
||||
{ return cursor_hideable; }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline void FVTerm::hideVTermCursor() const
|
||||
{ vterm->input_cursor_visible = false; }
|
||||
|
||||
} // namespace finalcut
|
||||
|
||||
|
|
Loading…
Reference in New Issue