[gimp] Use #defines instead of magic values for the tag spacing constants
- From: Michael Natterer <mitch src gnome org>
- To: svn-commits-list gnome org
- Subject: [gimp] Use #defines instead of magic values for the tag spacing constants
- Date: Fri, 10 Jul 2009 18:15:16 +0000 (UTC)
commit 8995cdf9d7bdee6fe884205400975a47d13196e3
Author: Michael Natterer <mitch gimp org>
Date: Fri Jul 10 02:25:25 2009 +0200
Use #defines instead of magic values for the tag spacing constants
app/widgets/gimptagpopup.c | 21 +++++++++++----------
1 files changed, 11 insertions(+), 10 deletions(-)
---
diff --git a/app/widgets/gimptagpopup.c b/app/widgets/gimptagpopup.c
index 39571a0..dbe42b8 100644
--- a/app/widgets/gimptagpopup.c
+++ b/app/widgets/gimptagpopup.c
@@ -41,13 +41,15 @@
#include "gimp-intl.h"
-#define MENU_SCROLL_STEP1 8
-#define MENU_SCROLL_STEP2 15
-#define MENU_SCROLL_FAST_ZONE 8
-#define MENU_SCROLL_TIMEOUT1 50
-#define MENU_SCROLL_TIMEOUT2 20
+#define MENU_SCROLL_STEP1 8
+#define MENU_SCROLL_STEP2 15
+#define MENU_SCROLL_FAST_ZONE 8
+#define MENU_SCROLL_TIMEOUT1 50
+#define MENU_SCROLL_TIMEOUT2 20
-#define GIMP_TAG_POPUP_MARGIN 5
+#define GIMP_TAG_POPUP_MARGIN 5
+#define GIMP_TAG_POPUP_SPACING_X 3
+#define GIMP_TAG_POPUP_SPACING_Y 2
struct _PopupTagData
@@ -505,10 +507,11 @@ gimp_tag_popup_layout_tags (GimpTagPopup *popup,
tag_data->bounds.width = PANGO_PIXELS (w);
tag_data->bounds.height = PANGO_PIXELS (h);
- if (tag_data->bounds.width + x + 3 + GIMP_TAG_POPUP_MARGIN > width)
+ if (x + GIMP_TAG_POPUP_SPACING_X + tag_data->bounds.width +
+ GIMP_TAG_POPUP_MARGIN > width)
{
x = GIMP_TAG_POPUP_MARGIN;
- y += line_height + 2;
+ y += line_height + GIMP_TAG_POPUP_SPACING_Y;
}
tag_data->bounds.x = x;
@@ -519,8 +522,6 @@ gimp_tag_popup_layout_tags (GimpTagPopup *popup,
if (gtk_widget_get_direction (GTK_WIDGET (popup)) == GTK_TEXT_DIR_RTL)
{
- GList *iterator;
-
for (i = 0; i < popup->tag_count; i++)
{
PopupTagData *tag_data = &popup->tag_data[i];
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]