Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
midwan committed Aug 28, 2024
2 parents e8f4929 + dc1a1a5 commit 1781a81
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 23 deletions.
2 changes: 1 addition & 1 deletion TODO
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
* Continue rebasing from a451b58f3da13d686702689ccbe92c44b8362c6e
* Continue rebasing from 24a11fbf50826a76862ff5667d371981628a0cbc
* Add a focus listener interface.
* Make focus apply synchronously.
* Graphics and input objects for DirectX.
Expand Down
4 changes: 2 additions & 2 deletions include/guisan/imageloader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@
#ifndef GCN_IMAGELOADER_HPP
#define GCN_IMAGELOADER_HPP

#include <iosfwd>

#include "guisan/platform.hpp"

#include <string>

namespace gcn
{
class Image;
Expand Down
8 changes: 8 additions & 0 deletions src/graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ namespace gcn

bool Graphics::pushClipArea(Rectangle area)
{
// Ignore area with a negative width or height
// by simple pushing an empty clip area to the stack.
if (area.width < 0 || area.height < 0)
{
ClipRectangle carea;
mClipStack.push(carea);
return true;
}
if (mClipStack.empty())
{
ClipRectangle carea;
Expand Down
11 changes: 8 additions & 3 deletions src/widgets/tabbedarea.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,8 +426,7 @@ namespace gcn

void TabbedArea::mousePressed(MouseEvent& mouseEvent)
{
if (mouseEvent.isConsumed()
&& mouseEvent.getSource()->isFocusable())
if (mouseEvent.isConsumed())
{
return;
}
Expand All @@ -443,7 +442,13 @@ namespace gcn
}
}

requestFocus();
// Request focus only if the source of the event is not focusable.
// If the source of the event is focused
// we don't want to steal the focus.
if (!mouseEvent.getSource()->isFocusable())
{
requestFocus();
}
}

void TabbedArea::death(const Event& event)
Expand Down
17 changes: 0 additions & 17 deletions src/widgets/textbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ namespace gcn
addKeyListener(this);
adjustSize();
setFrameSize(1);
setText("");
}

TextBox::TextBox(const std::string& text)
Expand Down Expand Up @@ -133,22 +132,6 @@ namespace gcn

void TextBox::draw(Graphics* graphics)
{
/*
int width = getWidth() + getFrameSize() * 2 - 1;
int height = getHeight() + getFrameSize() * 2 - 1;
graphics->setColor(getBackgroundColor());
unsigned int i;
for (i = 0; i < getFrameSize(); ++i)
{
graphics->drawLine(i,i, width - i, i);
graphics->drawLine(i,i + 1, i, height - i - 1);
graphics->drawLine(width - i,i + 1, width - i, height - i);
graphics->drawLine(i,height - i, width - i - 1, height - i);
}
*/

unsigned int i;

if (mOpaque)
Expand Down

0 comments on commit 1781a81

Please sign in to comment.