summaryrefslogtreecommitdiff
path: root/Plugins/emoticons/EmoticonsSelectionLayout.cpp
diff options
context:
space:
mode:
authorpescuma <pescuma@c086bb3d-8645-0410-b8da-73a8550f86e7>2008-04-26 23:11:12 +0000
committerpescuma <pescuma@c086bb3d-8645-0410-b8da-73a8550f86e7>2008-04-26 23:11:12 +0000
commitd052a59d5fbbdd17035ed92fee43932381a1e5c9 (patch)
tree6db5b377dde18a142d441ba53618b959a3d28850 /Plugins/emoticons/EmoticonsSelectionLayout.cpp
parent97a1ad6aa3f9696313a6d1e2e073b1e08a6b5682 (diff)
Handle metacontact change in the middle of chat
Works with miranda 0.7 Version bump: 0.0.2.4 git-svn-id: http://pescuma.googlecode.com/svn/trunk/Miranda@89 c086bb3d-8645-0410-b8da-73a8550f86e7
Diffstat (limited to 'Plugins/emoticons/EmoticonsSelectionLayout.cpp')
-rw-r--r--Plugins/emoticons/EmoticonsSelectionLayout.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/Plugins/emoticons/EmoticonsSelectionLayout.cpp b/Plugins/emoticons/EmoticonsSelectionLayout.cpp
index ba99e16..5c58244 100644
--- a/Plugins/emoticons/EmoticonsSelectionLayout.cpp
+++ b/Plugins/emoticons/EmoticonsSelectionLayout.cpp
@@ -131,6 +131,19 @@ int EmoticonsSelectionLayout::GetNumOfCols(int num_emotes)
int cols = num_emotes / MAX_LINES;
if (num_emotes % MAX_LINES != 0)
cols++;
+
+ if (cols < MAX_COLS)
+ {
+ cols = max(cols, MIN_COLS);
+ for(int i = 2; i > -3; i--)
+ {
+ if (num_emotes % (cols+i) == 0)
+ {
+ cols += i;
+ return cols;
+ }
+ }
+ }
return min(max(MIN_COLS, min(cols, MAX_COLS)), num_emotes);
}